/* ================================
   Bull Put Spread Calculator Page
   Look & feel follows Diversification Calculator
================================ */

*{
    box-sizing:border-box;
}

html,
body{
    margin:0;
    min-height:100%;
}

body{
    background:
        radial-gradient(circle at top right,rgba(37,99,235,.08),transparent 30%),
        #020617;
    color:#e5e7eb;
    font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

/* ================================
   HEADER
================================ */

header{
    min-height:64px;
    padding:0 28px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px;
    background:rgba(2,6,23,.94);
    border-bottom:1px solid rgba(255,255,255,.08);
    position:sticky;
    top:0;
    z-index:20;
    backdrop-filter:blur(12px);
}

.logo{
    color:#e5e7eb;
    text-decoration:none;
    font-weight:700;
    letter-spacing:-.02em;
}

nav{
    display:flex;
    gap:22px;
}

nav a{
    color:#94a3b8;
    text-decoration:none;
    font-size:.9rem;
    transition:color .2s ease;
}

nav a:hover{
    color:#e5e7eb;
}

/* ================================
   PAGE
================================ */

main{
    min-height:calc(100vh - 118px);
}

.scroll-area{
    width:100%;
    padding:34px 16px 60px;
}

.calculator-wrapper{
    max-width:760px;
    margin:40px auto;
    padding:0;
}

/* ================================
   CARD
================================ */

.calculator-card{
    background:linear-gradient(180deg,#0f172a,#020617);
    border-radius:18px;
    padding:30px 32px;
    border:1px solid rgba(255,255,255,.08);
    box-shadow:0 25px 60px rgba(0,0,0,.55);
}

.calculator-card h1{
    font-size:1.6rem;
    margin:0 0 6px;
    color:#e5e7eb;
}

.subtitle{
    color:#9ca3af;
    margin:0 0 22px;
    line-height:1.6;
}

.calculator-card h2{
    margin:26px 0 12px;
    font-size:1.15rem;
    color:#93c5fd;
}

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

.calculator-card label:not(.checkbox-label){
    display:block;
    margin-top:14px;
    margin-bottom:6px;
    color:#cbd5f5;
    font-size:.95rem;
}

.calculator-card input[type=number]{
    width:100%;
    padding:12px 14px;
    border-radius:10px;
    border:1px solid rgba(255,255,255,.15);
    outline:none;
    background:#020617;
    color:#e5e7eb;
    font-size:1rem;
    transition:border-color .2s ease,box-shadow .2s ease;
}

.calculator-card input[type=number]::placeholder{
    color:#64748b;
}

.calculator-card input[type=number]:focus{
    border-color:rgba(96,165,250,.65);
    box-shadow:0 0 0 3px rgba(37,99,235,.12);
}

.calculator-card input[type=number]::-webkit-outer-spin-button,
.calculator-card input[type=number]::-webkit-inner-spin-button{
    -webkit-appearance:none;
    margin:0;
}

.calculator-card input[type=number]{
    appearance:textfield;
}

.checkbox-label{
    display:flex;
    align-items:center;
    gap:10px;
    margin-top:18px;
    padding:12px 14px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:10px;
    background:rgba(2,6,23,.55);
    color:#cbd5e1;
    font-size:.88rem;
    cursor:pointer;
}

.checkbox-label input[type=checkbox]{
    width:17px;
    height:17px;
    margin:0;
    accent-color:#2563eb;
    cursor:pointer;
}

/* ================================
   BUTTON
================================ */

.field-help{
    margin:6px 0 0;
    color:#64748b;
    font-size:.72rem;
    line-height:1.45;
}

#hedgePremiumInput{
    margin-top:14px;
}

#hedgePremiumInput label{
    margin-top:0;
}

#calculateBtn{
    margin-top:22px;
    width:100%;
    padding:14px;
    border-radius:12px;
    border:none;
    background:linear-gradient(90deg,#2563eb,#22d3ee);
    color:#020617;
    font-size:1rem;
    font-weight:600;
    cursor:pointer;
    transition:opacity .2s ease,transform .15s ease;
}

#calculateBtn:hover{
    opacity:.92;
    transform:translateY(-1px);
}

/* ================================
   VALIDATION
================================ */

.validation-note{
    margin-top:14px;
    padding:10px 12px;
    border-radius:9px;
    font-size:.82rem;
    display:none;
}

.validation-note.error{
    display:block;
    color:#fca5a5;
    background:rgba(239,68,68,.07);
    border:1px solid rgba(239,68,68,.15);
}

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

.hidden{
    display:none!important;
}

.result-panel{
    margin-top:26px;
    padding-top:24px;
    border-top:1px dashed rgba(255,255,255,.12);
}

.result-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:18px;
    margin-bottom:18px;
}

.result-eyebrow{
    color:#60a5fa;
    font-size:.72rem;
    font-weight:800;
    letter-spacing:.18em;
}

.result-header h3{
    margin:5px 0 0;
    color:#f8fafc;
    font-size:1.05rem;
}

.status-pill{
    padding:7px 10px;
    border-radius:999px;
    font-size:.67rem;
    font-weight:800;
    letter-spacing:.06em;
}

.status-pill.safe{
    color:#86efac;
    background:rgba(34,197,94,.1);
    border:1px solid rgba(34,197,94,.2);
}

.status-pill.danger{
    color:#fca5a5;
    background:rgba(239,68,68,.1);
    border:1px solid rgba(239,68,68,.2);
}

/* ================================
   STRATEGY FLOW
================================ */

.strategy-flow{
    display:grid;
    grid-template-columns:1fr 52px 1fr;
    align-items:center;
    gap:12px;
    margin-bottom:18px;
}

.strategy-leg{
    padding:18px;
    border-radius:13px;
    background:rgba(2,6,23,.8);
    border:1px solid rgba(255,255,255,.08);
}

.strategy-leg span{
    display:block;
    font-size:.67rem;
    font-weight:800;
    letter-spacing:.1em;
}

.strategy-leg strong{
    display:block;
    margin-top:8px;
    color:#f8fafc;
    font-size:1.55rem;
}

.strategy-leg small{
    display:block;
    margin-top:5px;
    color:#64748b;
    font-size:.72rem;
}

.sell-leg span{
    color:#fca5a5;
}

.hedge-leg span{
    color:#93c5fd;
}

.strategy-arrow{
    width:42px;
    height:42px;
    display:flex;
    align-items:center;
    justify-content:center;
    margin:auto;
    border-radius:50%;
    background:rgba(37,99,235,.08);
    border:1px solid rgba(96,165,250,.2);
    color:#60a5fa;
    font-size:18px;
}

/* ================================
   RESULT GRID
================================ */

.result-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
}

.result-box{
    min-height:105px;
    padding:16px;
    border-radius:13px;
    background:rgba(2,6,23,.8);
    border:1px solid rgba(255,255,255,.08);
}

.result-box span{
    display:block;
    color:#64748b;
    font-size:.67rem;
    font-weight:800;
    letter-spacing:.1em;
}

.result-box strong{
    display:block;
    margin-top:9px;
    color:#f8fafc;
    font-size:1.22rem;
}

.result-box small{
    display:block;
    margin-top:5px;
    color:#64748b;
    font-size:.72rem;
    line-height:1.35;
}

.result-box.profit{
    border-color:rgba(34,197,94,.2);
}

.result-box.profit strong{
    color:#86efac;
    font-size:1rem;
    line-height:1.35;
}

.result-box.loss{
    border-color:rgba(239,68,68,.2);
}

.result-box.loss strong{
    color:#fca5a5;
}

/* ================================
   TABLE
================================ */

.calculation-table-wrap{
    margin-top:18px;
    overflow-x:auto;
    border:1px solid rgba(255,255,255,.07);
    border-radius:12px;
}

.calculation-table{
    width:100%;
    border-collapse:collapse;
    min-width:620px;
}

.calculation-table th,
.calculation-table td{
    padding:12px 14px;
    text-align:left;
    border-bottom:1px solid rgba(255,255,255,.06);
}

.calculation-table th{
    color:#93c5fd;
    background:rgba(15,23,42,.9);
    font-size:.73rem;
    letter-spacing:.06em;
    text-transform:uppercase;
}

.calculation-table td{
    color:#cbd5e1;
    font-size:.84rem;
}

.calculation-table tr:last-child td{
    border-bottom:0;
}

/* ================================
   NOTE
================================ */

.calculator-note{
    margin:20px 0 0;
    padding-top:14px;
    border-top:1px dashed rgba(255,255,255,.1);
    color:#64748b;
    font-size:.78rem;
    line-height:1.55;
}

/* ================================
   FOOTER
================================ */

footer{
    padding:18px;
    text-align:center;
    color:#475569;
    border-top:1px solid rgba(255,255,255,.06);
    font-size:.75rem;
}

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

@media(max-width:800px){
    .result-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media(max-width:650px){
    header{
        padding:12px 18px;
        align-items:flex-start;
        flex-direction:column;
    }

    nav{
        gap:14px;
        flex-wrap:wrap;
    }

    .calculator-wrapper{
        margin:20px auto;
    }

    .calculator-card{
        padding:22px 20px;
        border-radius:15px;
    }

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

    .strategy-flow{
        grid-template-columns:1fr;
    }

    .strategy-arrow{
        transform:rotate(90deg);
    }

    .result-header{
        align-items:flex-start;
        flex-direction:column;
    }
}
