/* ==========================================================
   AUTH PAGES — garden theme, matches checkout.css conventions
   ========================================================== */

.auth-page{

    padding:4rem 0 6rem;

    background:#fbfdf9;

    min-height:75vh;

    display:flex;

    align-items:center;
}

.auth-container{

    width:90%;

    max-width:30rem;

    margin:auto;
}

.auth-card{

    background:#fff;

    border:1px solid #e7efe4;

    border-radius:20px;

    padding:2.4rem 2rem;

    box-shadow:0 10px 34px rgba(20,80,30,.07);

    text-align:center;

    opacity:0;

    animation:authCardIn .5s cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes authCardIn{

    from{

        opacity:0;

        transform:translateY(16px) scale(.98);
    }

    to{

        opacity:1;

        transform:translateY(0) scale(1);
    }
}

.auth-icon{

    width:4.2rem;

    height:4.2rem;

    margin:0 auto 1.1rem;

    border-radius:50%;

    background:linear-gradient(180deg,#0ba82d,#078220);

    color:#fff;

    display:flex;

    align-items:center;

    justify-content:center;

    font-size:1.7rem;

    box-shadow:0 8px 20px rgba(11,143,45,.28);

    opacity:0;

    animation:iconPop .5s cubic-bezier(.22,1,.36,1) .15s forwards;
}

@keyframes iconPop{

    0%{ opacity:0; transform:scale(.4) rotate(-30deg); }

    70%{ transform:scale(1.1) rotate(4deg); }

    100%{ opacity:1; transform:scale(1) rotate(0deg); }
}

.auth-card h1{

    font-size:1.5rem;

    font-weight:800;

    color:#111;

    margin-bottom:.4rem;
}

.auth-sub{

    color:#6b7a68;

    font-size:.9rem;

    margin-bottom:1.6rem;

    line-height:1.5;
}

.auth-sub strong{

    color:#1d1d1d;
}

/* ==========================================================
   MESSAGES
   ========================================================== */

.auth-messages{

    margin-bottom:1.2rem;
}

.auth-message{

    padding:.7rem 1rem;

    border-radius:10px;

    font-size:.85rem;

    font-weight:600;

    margin-bottom:.6rem;

    text-align:left;
}

.auth-message.success{

    background:#eaf7e6;

    color:#0b8f2d;
}

.auth-message.error{

    background:#fdecea;

    color:#c0392b;
}

/* ==========================================================
   FORM FIELDS
   ========================================================== */

.field-group{

    text-align:left;

    margin-bottom:1.2rem;
}

.field-group label{

    display:block;

    font-size:.82rem;

    font-weight:600;

    color:#333;

    margin-bottom:.4rem;
}

.field-group input[type="text"],
.field-group input[type="email"]{

    width:100%;

    height:2.9rem;

    padding:0 1rem;

    border:1px solid #dfe8dc;

    border-radius:10px;

    font-size:.92rem;

    background:#fbfdf9;

    transition:border-color .2s ease;
}

.field-group input:focus{

    outline:none;

    border-color:#0b8f2d;
}

.field-group input.invalid{

    border-color:#e0453b;

    background:#fff8f7;
}

.phone-input-wrap{

    display:flex;

    align-items:center;

    border:1px solid #dfe8dc;

    border-radius:10px;

    overflow:hidden;

    background:#fbfdf9;

    transition:border-color .2s ease;
}

.phone-input-wrap:focus-within{

    border-color:#0b8f2d;
}

.phone-prefix{

    padding:0 .8rem;

    font-size:.92rem;

    font-weight:600;

    color:#6b7a68;

    border-right:1px solid #e2ece0;
}

.phone-input-wrap input{

    border:none !important;

    background:transparent !important;

    flex:1;
}

.field-error{

    display:none;

    color:#c0392b;

    font-size:.78rem;

    font-weight:500;

    margin-top:.35rem;
}

.field-error.show{

    display:block;

    animation:errorSlideIn .25s ease forwards;
}

@keyframes errorSlideIn{

    from{ opacity:0; transform:translateY(-4px); }

    to{ opacity:1; transform:translateY(0); }
}

@keyframes shake{

    0%,100%{ transform:translateX(0); }

    20%{ transform:translateX(-6px); }

    40%{ transform:translateX(6px); }

    60%{ transform:translateX(-4px); }

    80%{ transform:translateX(4px); }
}

.shake{

    animation:shake .4s ease;
}

/* ==========================================================
   OTP BOXES
   ========================================================== */

.otp-box-row{

    display:flex;

    justify-content:center;

    gap:.6rem;

    margin-bottom:1rem;
}

.otp-box{

    width:2.8rem;

    height:3.2rem;

    text-align:center;

    font-size:1.4rem;

    font-weight:700;

    border:1.5px solid #dfe8dc;

    border-radius:10px;

    background:#fbfdf9;

    transition:border-color .2s ease, transform .15s ease;
}

.otp-box:focus{

    outline:none;

    border-color:#0b8f2d;

    transform:translateY(-2px);
}

.otp-box.filled{

    border-color:#0b8f2d;

    background:#f6fbf5;
}

.otp-error{

    display:block;

    text-align:center;

    margin:-.4rem 0 .8rem;
}

/* ==========================================================
   BUTTONS
   ========================================================== */

.auth-submit-btn{

    position:relative;

    width:100%;

    height:3rem;

    border:none;

    border-radius:10px;

    background:linear-gradient(180deg,#0ba82d,#078220);

    color:#fff;

    font-size:.95rem;

    font-weight:700;

    cursor:pointer;

    overflow:hidden;

    box-shadow:0 8px 20px rgba(11,143,45,.25);

    transition:transform .2s ease, box-shadow .3s ease;

    margin-top:.4rem;
}

.auth-submit-btn:hover{

    transform:translateY(-2px);

    box-shadow:0 12px 26px rgba(11,143,45,.32);
}

.auth-submit-btn .btn-label{

    transition:opacity .2s ease, transform .2s ease;
}

.auth-submit-btn .btn-spinner{

    position:absolute;

    top:50%;

    left:50%;

    width:1.1rem;

    height:1.1rem;

    margin:-.55rem 0 0 -.55rem;

    border:.16rem solid rgba(255,255,255,.4);

    border-top-color:#fff;

    border-radius:50%;

    opacity:0;

    transform:scale(.6);

    transition:opacity .2s ease, transform .2s ease;
}

.auth-submit-btn.is-loading .btn-label{

    opacity:0;

    transform:scale(.85);
}

.auth-submit-btn.is-loading .btn-spinner{

    opacity:1;

    transform:scale(1);

    animation:spin .7s linear infinite;
}

@keyframes spin{

    to{ transform:rotate(360deg); }
}

.auth-switch{

    margin-top:1.4rem;

    font-size:.85rem;

    color:#6b7a68;
}

.auth-switch a{

    color:#0b8f2d;

    font-weight:700;

    text-decoration:none;
}

.auth-switch a:hover{

    text-decoration:underline;
}

/* ==========================================================
   RESEND ROW
   ========================================================== */

.resend-row{

    margin-top:1.2rem;

    font-size:.85rem;

    color:#8a938a;
}

.resend-btn{

    display:none;

    border:none;

    background:none;

    color:#0b8f2d;

    font-weight:700;

    font-size:.85rem;

    cursor:pointer;
}

.resend-btn:not([disabled]){

    display:inline;
}

#resend-countdown.hidden{

    display:none;
}

@media(max-width:480px){

    .auth-card{

        padding:1.8rem 1.3rem;
    }

    .otp-box{

        width:2.4rem;

        height:2.9rem;

        font-size:1.2rem;
    }

    .otp-box-row{

        gap:.4rem;
    }
}

/* ==================================================================
   MODAL-STYLE PRESENTATION — gives the auth pages a centered
   dialog look with a soft blurred green backdrop (evoking the
   garden theme) and a close (X) button, similar to a real app's
   sign-in modal, instead of a plain flat page.
   (append this to the end of auth.css — nothing above it changes)
   ================================================================== */

.auth-page{

    position:relative;

    background:
        radial-gradient(circle at 20% 20%, rgba(11,143,45,.18), transparent 45%),
        radial-gradient(circle at 80% 75%, rgba(11,143,45,.15), transparent 50%),
        #eef4ea;

    overflow:hidden;
}

.auth-page::before{

    content:"";

    position:absolute;

    inset:0;

    backdrop-filter:blur(2px);

    background:rgba(255,255,255,.35);
}

.auth-card{

    position:relative;

    z-index:2;
}

.auth-close-btn{

    position:absolute;

    top:0.8rem;

    right:0.8rem;

    width:2.4rem;

    height:2.4rem;

    display:flex;

    align-items:center;

    justify-content:center;

    background:#fff;

    color:#333;

    border-radius:50%;

    box-shadow:0 .4rem 1.2rem rgba(0,0,0,.15);

    font-size:1rem;

    text-decoration:none;

    transition:.25s ease;

    z-index:3;
}

.auth-close-btn:hover{

    background:#e0453b;

    color:#fff;

    transform:rotate(90deg);
}

@media(max-width:480px){

    .auth-close-btn{

      top:0.8rem;

    right:0.8rem;

        width:2.1rem;

        height:2.1rem;
    }
}

/* ==================================================================
   AUTH MODAL — overlay + box. This is what auth-modal.js shows/hides.
   backdrop-filter:blur() here is what actually blurs the real page
   content behind it (unlike the earlier fake-backdrop version) --
   the browser samples whatever's rendered underneath this layer.
   (append to the end of auth.css — nothing above it changes, and
   your existing full-page .auth-page / .auth-card styles are
   untouched, so direct navigation to /login/ etc. still works
   exactly as before as a fallback)
   ================================================================== */

.auth-modal-overlay{

    position:fixed;

    inset:0;

    display:none;

    align-items:center;

    justify-content:center;

    padding:1.5rem;

    background:rgba(20,40,25,.28);

    backdrop-filter:blur(7px);

    -webkit-backdrop-filter:blur(7px);

    z-index:99999;

    opacity:0;

    transition:opacity .3s ease;
}

.auth-modal-overlay.show{

    display:flex;

    opacity:1;
}

.auth-modal-box{

    width:100%;

    max-width:30rem;

    max-height:90vh;

    overflow-y:auto;

    transform:scale(.94) translateY(14px);

    transition:transform .35s cubic-bezier(.22,1,.36,1);
}

.auth-modal-overlay.show .auth-modal-box{

    transform:scale(1) translateY(0);
}

/* the .auth-card injected inside already has its own entrance
   animation (authCardIn) -- it naturally replays every time the
   modal swaps to a new step (phone -> OTP), which gives a nice
   little transition between steps for free. Just make sure it isn't
   sitting inside the old full-page centering context anymore. */

.auth-modal-box .auth-card{

    margin:0;
}

body.auth-modal-open{

    overflow:hidden;
}

@media(max-width:480px){

    .auth-modal-overlay{

        padding:1rem;

        align-items:flex-end;
    }

    .auth-modal-box{

        max-height:85vh;
    }
}