/* =========================================================
   CVEWORKS - NUMBER CONVERTER
   Light / Red / White visual identity
   Header, footer, typography and spacing based on the
   CVEWorks style supplied by the site.
========================================================= */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body{
    font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
    background:#f7f7f8;
    color:#202124;
    line-height:1.5;
}

a{
    color:inherit;
    text-decoration:none;
}

button,
input,
select,
textarea{
    font:inherit;
}

.container{
    width:100%;
    max-width:1180px;
    margin:0 auto;
    padding:0 24px;
}


/* =========================================================
   HACKERDNA AFFILIATE
========================================================= */

.affiliate-section{
    padding:64px 0;
    background:#f7f7f8
}

.affiliate-box{
    position:relative;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:40px;
    padding:38px 42px;
    background:#fff;
    border:1px solid #e5e5e5;
    border-radius:14px;
    box-shadow:0 3px 15px rgba(0,0,0,.035);
    overflow:hidden
}

.affiliate-box::after{
    content:"";
    position:absolute;
    width:260px;
    height:260px;
    right:-120px;
    top:-130px;
    border-radius:50%;
    background:#d71920;
    opacity:.035;
    pointer-events:none
}

.affiliate-content{
    position:relative;
    z-index:1;
    max-width:760px
}

.affiliate-box h2{
    margin-top:12px;
    color:#171717;
    font-size:28px;
    line-height:1.2
}

.affiliate-box p{
    margin-top:8px;
    color:#686868;
    font-size:14px;
    line-height:1.7
}

.affiliate-button{
    position:relative;
    z-index:1;
    flex-shrink:0;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:12px;
    min-height:46px;
    padding:0 20px;
    border-radius:8px;
    background:#d71920;
    color:#fff;
    font-size:14px;
    font-weight:800;
    box-shadow:0 5px 16px rgba(215,25,32,.18);
    transition:.2s ease
}

.affiliate-button:hover{
    background:#bd151b;
    transform:translateY(-1px)
}

.affiliate-button span{
    font-size:18px
}

.affiliate-disclosure{
    margin-top:13px !important;
    color:#999 !important;
    font-size:11px !important;
    line-height:1.5 !important
}




/* =========================================================
   HEADER
   CVEWorks standard header
========================================================= */

.site-header{
    background:#fff;
    border-bottom:1px solid #eee;
}

.header-content{
    min-height:70px;
    display:flex;
    align-items:center;
    justify-content:space-between;
}

.logo{
    display:flex;
    align-items:center;
    gap:10px;
    text-decoration:none;
    color:#171717;
}

.logo-mark{
    width:40px;
    height:40px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:9px;
    background:#d71920;
    color:#fff;
    font-size:11px;
    font-weight:900;
}

.logo-name{
    color:#171717;
    font-size:21px;
    font-weight:800;
    line-height:1;
}

.logo-name span{
    color:#d71920;
}

.navigation{
    display:flex;
    align-items:center;
    gap:6px;
}

.navigation a{
    padding:9px 11px;
    border-radius:7px;
    color:#555;
    font-size:13px;
    font-weight:600;
    transition:.2s ease;
}

.navigation a:hover{
    color:#d71920;
    background:#fff5f5;
}

/* Compatibility with the previous header class names */
.site-header-inner{
    min-height:70px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
}

.site-logo{
    color:#171717;
    font-size:21px;
    font-weight:800;
}

.site-nav{
    display:flex;
    align-items:center;
    gap:3px;
}

.site-nav a{
    padding:9px 11px;
    border-radius:7px;
    color:#666;
    font-size:13px;
    font-weight:600;
    transition:.2s ease;
}

.site-nav a:hover{
    color:#d71920;
    background:#fff5f5;
}

/* =========================================================
   HERO
========================================================= */

.tool-hero{
    padding:76px 0 54px;
    text-align:center;
}

.hero-badge{
    display:inline-block;
    margin-bottom:10px;
    color:#d71920;
    font-size:10px;
    font-weight:900;
    letter-spacing:.12em;
}

.tool-hero h1{
    color:#171717;
    font-size:42px;
    font-weight:800;
    line-height:1.15;
}

.tool-hero h1 span{
    color:#d71920;
}

.hero-description{
    max-width:760px;
    margin-top:12px;
    margin-left:auto;
    margin-right:auto;
    color:#686868;
    font-size:15px;
    line-height:1.7;
}

/* =========================================================
   MAIN
========================================================= */

.site-section{
    padding:0 0 48px;
}

.instructions,
.input-card,
.card{
    background:#fff;
    border:1px solid #efb3b6;
    border-radius:14px;
    box-shadow:0 3px 15px rgba(0,0,0,.035);
}

.instructions{
    padding:30px;
}

.instructions h2,
.input-card h2,
.card h2,
.seo-content h2{
    color:#171717;
    font-size:21px;
    line-height:1.25;
}

.instructions > p,
.card-description{
    margin-top:8px;
    color:#666;
    font-size:13px;
    line-height:1.7;
}

.input-card{
    margin-top:22px;
    padding:30px;
}

/* =========================================================
   FORM
========================================================= */

.field{
    display:flex;
    flex-direction:column;
    gap:7px;
}

.field label{
    color:#555;
    font-size:12px;
    font-weight:800;
}

input,
select,
textarea{
    width:100%;
    border:1px solid #dcdcdc;
    border-radius:9px;
    outline:none;
    background:#fafafa;
    color:#202124;
    transition:.2s ease;
}

input,
select{
    min-height:43px;
    padding:10px 12px;
    font-size:13px;
}

textarea{
    min-height:115px;
    padding:14px;
    resize:vertical;
    font-size:13px;
}

textarea:first-of-type,
#numberInput,
#asciiInput{
    font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
}

input:focus,
select:focus,
textarea:focus{
    border-color:#d71920;
    background:#fff;
    box-shadow:0 0 0 3px rgba(215,25,32,.08);
}

.input-controls{
    display:flex;
    align-items:flex-end;
    gap:14px;
    margin-top:15px;
}

.input-controls .field:first-child{
    width:240px;
}

.custom-base{
    width:110px;
}

.hidden{
    display:none!important;
}

.error-message{
    margin-top:12px;
    padding:10px 12px;
    border:1px solid #f4c9cc;
    border-radius:8px;
    background:#fff5f5;
    color:#a52b31;
    font-size:12px;
}

/* =========================================================
   BUTTONS
========================================================= */

.actions{
    display:flex;
    align-items:center;
    gap:10px;
    margin-top:18px;
}

.btn-primary,
.btn-secondary{
    min-height:42px;
    padding:0 16px;
    border-radius:8px;
    cursor:pointer;
    font-size:12px;
    font-weight:800;
    transition:.2s ease;
}

.btn-primary{
    border:1px solid #d71920;
    background:#d71920;
    color:#fff;
    box-shadow:0 5px 16px rgba(215,25,32,.18);
}

.btn-primary:hover{
    background:#bd151b;
    border-color:#bd151b;
    transform:translateY(-1px);
}

.btn-secondary{
    border:1px solid #d7d7d7;
    background:#fff;
    color:#555;
}

.btn-secondary:hover{
    border-color:#d71920;
    background:#fff5f5;
    color:#d71920;
}

.btn-secondary.small{
    min-height:36px;
    padding:0 12px;
}

/* =========================================================
   BASE RESULTS
========================================================= */

.results-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    margin-top:25px;
    margin-bottom:11px;
}

.results-header h3,
.section-heading h3{
    color:#171717;
    font-size:15px;
}

.results-table{
    border:1px solid #e5e5e5;
    border-radius:9px;
    overflow:hidden;
}

.result-row{
    display:grid;
    grid-template-columns:135px minmax(0,1fr) auto;
    align-items:center;
    min-height:52px;
    border-bottom:1px solid #eee;
}

.result-row:last-child{
    border-bottom:0;
}

.result-row > span{
    padding:0 13px;
    color:#777;
    font-size:11px;
    font-weight:800;
}

.result-row strong{
    min-width:0;
    padding:10px;
    color:#252525;
    font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
    font-size:12px;
    overflow-wrap:anywhere;
    word-break:break-word;
}

.copy-btn{
    margin-right:9px;
    padding:6px 9px;
    border:1px solid #ddd;
    border-radius:6px;
    background:#fff;
    color:#666;
    cursor:pointer;
    font-size:10px;
}

.copy-btn:hover{
    border-color:#d71920;
    color:#d71920;
}

.bit-section{
    margin-top:25px;
}

.section-heading{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    margin-bottom:10px;
}

.bit-selector{
    display:flex;
    gap:5px;
}

.bit-button{
    padding:6px 9px;
    border:1px solid #d7d7d7;
    border-radius:6px;
    background:#fff;
    color:#666;
    cursor:pointer;
    font-size:10px;
    font-weight:700;
}

.bit-button.active{
    border-color:#d71920;
    background:#d71920;
    color:#fff;
}

.bit-result{
    min-height:50px;
    display:flex;
    align-items:center;
    padding:13px;
    border-radius:8px;
    background:#202124;
    color:#fff;
    font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
    font-size:13px;
    letter-spacing:1px;
    overflow-x:auto;
}

/* =========================================================
   TOOL CARDS
========================================================= */

.tool-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:18px;
    margin-top:18px;
}

.card{
    padding:24px;
}

.card h2{
    font-size:18px;
}

.card-description{
    min-height:44px;
}

.two-fields{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
    margin-top:18px;
}

.output-list{
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-top:18px;
}

.output-row{
    display:grid;
    grid-template-columns:105px minmax(0,1fr);
    gap:10px;
    align-items:center;
    min-height:42px;
    padding:9px 11px;
    border:1px solid #e8e8e8;
    border-radius:7px;
    background:#fafafa;
}

.output-row span{
    color:#777;
    font-size:11px;
    font-weight:800;
}

.output-row strong{
    min-width:0;
    color:#333;
    font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
    font-size:11px;
    overflow-wrap:anywhere;
    word-break:break-word;
}

.operation-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin-top:18px;
}

.operation-grid > div{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    min-height:44px;
    padding:9px 11px;
    border:1px solid #e8e8e8;
    border-radius:7px;
    background:#fafafa;
}

.operation-grid span{
    color:#777;
    font-size:10px;
    font-weight:800;
}

.operation-grid strong{
    color:#333;
    font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
    font-size:11px;
}

.color-preview{
    width:100%;
    height:68px;
    margin-top:18px;
    border:1px solid #e5e5e5;
    border-radius:8px;
    background:#fafafa;
}

.data-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:8px;
    margin-top:18px;
}

.data-grid > div{
    min-width:0;
    padding:10px 11px;
    border:1px solid #e8e8e8;
    border-radius:7px;
    background:#fafafa;
}

.data-grid span{
    display:block;
    color:#777;
    font-size:10px;
    font-weight:800;
}

.data-grid strong{
    display:block;
    margin-top:4px;
    color:#333;
    font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
    font-size:11px;
    overflow-wrap:anywhere;
}

/* =========================================================
   SEO CONTENT
========================================================= */

.seo-content{
    margin-top:30px;
    padding:30px;
    background:#fff;
    border:1px solid #e2e2e2;
    border-radius:14px;
    box-shadow:0 3px 15px rgba(0,0,0,.035);
}

.seo-content h2 + p{
    margin-top:9px;
}

.seo-content h2 + p + h2{
    margin-top:25px;
}

.seo-content p{
    max-width:850px;
    color:#666;
    font-size:13px;
    line-height:1.75;
}

/* =========================================================
   FOOTER
   CVEWorks standard footer
========================================================= */

.copyright{
    border-top:1px solid #eee;
    background:#fff;
    color:#777;
    font-size:12px;
}

.copyright .container{
    min-height:40px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
}

.copyright a{
    color:#d71920;
    text-decoration:none;
}

.copyright a:hover{
    text-decoration:underline;
}

.footer-left,
.footer-right{
    color:#777;
    font-size:12px;
}

.footer-right{
    text-align:right;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media(max-width:900px){
    .tool-grid{
        grid-template-columns:1fr;
    }
}

@media(max-width:680px){
    .container{
        padding-left:18px;
        padding-right:18px;
    }

    .site-header-inner{
        min-height:64px;
    }

    .site-logo{
        font-size:19px;
    }

    .site-nav{
        gap:2px;
    }

    .site-nav a{
        padding:8px 8px;
        font-size:12px;
    }

    .tool-hero{
        padding:55px 0 35px;
    }

    .tool-hero h1{
        font-size:34px;
    }

    .hero-description{
        font-size:13px;
    }

    .instructions,
    .input-card,
    .card,
    .seo-content{
        padding:22px;
    }

    .input-controls,
    .two-fields{
        grid-template-columns:1fr;
        flex-direction:column;
        align-items:stretch;
    }

    .input-controls .field:first-child,
    .custom-base{
        width:100%;
    }

    .result-row{
        grid-template-columns:95px minmax(0,1fr);
    }

    .copy-btn{
        grid-column:2;
        justify-self:start;
        margin:0 0 8px 10px;
    }

    .section-heading{
        align-items:flex-start;
        flex-direction:column;
    }

    .bit-selector{
        width:100%;
    }

    .bit-button{
        flex:1;
    }

    .operation-grid{
        grid-template-columns:1fr;
    }

    .copyright .container{
        min-height:auto;
        padding-top:16px;
        padding-bottom:16px;
        flex-direction:column;
        align-items:flex-start;
    }
}

@media(max-width:420px){
    .header-content{
        gap:8px;
    }

    .navigation{
        gap:0;
    }

    .navigation a{
        padding:7px 5px;
        font-size:11px;
    }

    .tool-hero h1{
        font-size:30px;
    }
}
