* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

:root{
--primary                     :#660b0a;
--primary-hover               :#8a1412;
--secondary                   :#f8b526;
--text                        :#212d45;
--bg                          :#F5F5F5;
--card                        :#ffffff;
--success                     :#186b42;
--succeshover                 :#145a37;
--tertiary                    :#012734;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    background: linear-gradient(135deg, #eef2f6, #dbe3ea);
    overflow-x: hidden;
}

.container {
    position: relative;
    width: 850px;
    max-width: 90vw;
    height: 550px;
    background: var(--card);
    border-radius: 30px;
    /* Stronger, cool-toned shadow than the old dark-background version —
       a plain black shadow read as too faint to separate the white card
       from this light background. */
    box-shadow: 0 15px 45px rgba(33, 45, 69, 0.18);
    overflow: hidden;
    margin: 20px;
}


.logo {
    position: fixed; 
    top: 20px;       
    left: 20px;      
    z-index: 999;    
}

.logo img {
    height: 60px;    
    width: auto;
}

.form-box {
    position: absolute;
    right: 0;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    background: var(--card);
    color: #333;
    text-align: center;
    padding: 40px;
    z-index: 1;
    transition: .6s ease-in-out 1.2s, visibility 0s 1s;
}

.container.active .form-box {
    right: 50%;
}

.form-box.registration {
    visibility: hidden;
}

.container.active .form-box.registration {
    visibility: visible;
}

form {
    width: 100%;
}

.container h1 {
    font-size: 32px;
    margin: -10px 0;
}

.input-box {
    position: relative;
    margin: 30px 0;
}

.input-box input {
    width: 100%;
    padding: 13px 46px 13px 20px;
    background: var(--bg);
    border-radius: 8px;
    /* border: 1px solid var(--card); */
    outline: none;
    font-size: 16px;
    color: #333;
    font-weight: 500;
    border:1px solid #dcdcdc;
    /* transition:0.3s; */
}


.input-box input:focus {
    border: 1px solid var(--tertiary);
}

.input-box input::placeholder {
    color: #888;
    font-weight: 400;
}

.input-box i {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #9a9a9a;
    pointer-events: none;
}

.input-box input:focus ~ i,
.input-box select:focus ~ i {
    color: var(--tertiary);
}

/* Show/hide password eye — a real button (the icons above ignore clicks). */
.input-box .toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 10px;
    background: none;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    line-height: 1;
    color: #9a9a9a;
    cursor: pointer;
}

.input-box .toggle-password i {
    position: static;
    transform: none;
    color: inherit;
}

.input-box input:focus ~ .toggle-password,
.input-box .toggle-password:hover,
.input-box .toggle-password:focus-visible {
    color: var(--tertiary);
}

/* Edge adds its own reveal eye to password fields — keep only ours. */
.input-box input::-ms-reveal {
    display: none;
}

.forget-link {
    margin: -15px 0 15px;
}

.forget-link a{
    font-size: 14.5px;
    color: #6c757d;          /* soft gray */
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.3s ease, opacity 0.3s ease;
}

.forget-link a:hover {
    color: var(--tertiary);          /* soft navy */
    opacity: 0.9;
}


.btn {
    width: 100%;
    height: 48px;
    background: var(--success);
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #fff;
    font-weight: 600;
}

.btn:hover {
    background: var(--succeshover);
}

.toggle-box {
    position: absolute;
    width: 100%;
    height: 100%;
}

.toggle-box::before {
    content: '';
    position: absolute;
    left: -250%;
    width: 300%;
    height: 100%;
    background: var(--primary);
    z-index: 2;
    border-radius: 150px;
    transition: 1.8s ease-in-out;
}

.container.active .toggle-box::before {
    left: 50%;
}

.toggle-panel {
    position: absolute;
    width: 50%;
    height: 100%;
    color: #fff;
    /* background: greenyellow; */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    transition: .6s ease-in-out;
}

.toggle-panel.toggle-left {
    left: 0;
    transition-delay: 1.2s;
}

.container.active .toggle-panel.toggle-left {
    left: -50%;
    transition-delay: .6s;
} 

.toggle-panel.toggle-right {
    right: -50%;
    transition-delay: .6s;
}

.container.active .toggle-panel.toggle-right {
    right: 0;
    transition-delay: 1.2s;
}

.toggle-panel p{
    margin-bottom: 20px;
    margin-top: 20px;
}

.toggle-panel .btn{
    width: 160px;
    height: 46px;
    background: transparent;
    border: 2px solid #fff;
    box-shadow: none;
}

@media screen and (max-width:650px) {
    .container {
        /* 100vh on mobile browsers is measured against the address-bar-hidden
           viewport, taller than what's actually visible on first load, which
           forced a phantom scroll just to reach the bottom of the card.
           100dvh tracks the real visible viewport instead. */
        height: calc(100dvh - 40px);
    }

    .container h1 {
        /* Desktop's negative margin (see base rule above) is too tight once
           the mobile form-box adds its own padding-top; a little breathing
           room here is mobile-only and doesn't touch the desktop rule. */
        margin-top: 6px;
    }

    .form-box {
        bottom: 0;
        width: 100%;
        height: 65%;
        /* Registration has more fields than Login and can be taller than
           this slot on shorter phone screens — without this the extra
           height bled out past the box's top/bottom instead of scrolling.
           align-items switches to flex-start here because a centered flex
           item that overflows can't be scrolled to its own top in some
           browsers (the "flexbox overflow centering" quirk) — top-aligning
           plus the padding below keeps it looking centered when it fits,
           and scrolls cleanly from the top when it doesn't. */
        overflow-y: auto;
        align-items: flex-start;
        padding-top: 24px;
        padding-bottom: 20px;
    }
    .container.active .form-box {
        right: 0;
        bottom: 35%;
    }

    /* Tighter field spacing on small screens so Registration's 4 fields
       fit (or nearly fit) without needing the scroll above. */
    .input-box {
        margin: 16px 0;
    }
   /* .toggle-box {
        left: 0;
        top: -270%;
        width: 100%;
        height: 300%;
    } */

    .toggle-box::before {
        left: 0;
        top: -265%;
        width: 100%;
        height: 300%;
        border-radius: 20vw;
    }

    .container.active .toggle-box::before {
        left: 0;
        top: 65%;
    }
    .toggle-panel {
        width: 100%;
        height: 35%;
    }

     .toggle-panel.toggle-left {
        top: 0;
    }

    .container.active .toggle-panel.toggle-left {
        left: 0;
        top: -35%;
    }

    .toggle-panel.toggle-right {
        right: 0;
        bottom: -35%;
    }

    .container.active .toggle-panel.toggle-right {
        bottom: 0;
    }
}

@media screen and (max-width:800px) {
    .container h1{
        font-size: 26px;
    }

}

@media screen and (max-width:400px) {
    .form-box {
        padding: 20px;
    }

    .toggle-panel h1 {
        font-size: 24px;
    }
}




/* At screen width 1050px */
@media (max-width: 1050px) {
    .logo {
        top: 15px;
        left: 15px; /* move slightly left/top to avoid overlap */
    }
    .logo img {
        height: 55px;
    }
}

/* At screen width 900px */
@media (max-width: 900px) {
    .logo {
        top: 10px;
        left: 10px;
    }
    .logo img {
        height: 45px; /* smaller logo */
    }
}

/* At screen width 650px and below, hide logo */
@media (max-width: 650px) {
    .logo {
        display: none;
    }
}


.input-box select {
    width: 100%;
    padding: 13px 46px 13px 20px;
    background: var(--bg);
    border-radius: 8px;
    border:1px solid #dcdcdc;
    outline: none;
    font-size: 16px;
    color: #888;
    font-weight: 500;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.input-box select:focus {
    border: 1px solid var(--tertiary);
    background: #fff;
    color: #333;
}

/* Styled open list — only browsers that support customizable <select>
   (Chrome/Edge 135+). Others keep the native list with the styled box above. */
@supports (appearance: base-select) {
    .input-box select,
    .input-box select::picker(select) {
        appearance: base-select;
    }

    .input-box select {
        display: flex;
        align-items: center;
    }

    /* The box already shows its own field icon on the right. */
    .input-box select::picker-icon {
        display: none;
    }

    .input-box select::picker(select) {
        margin-top: 6px;
        padding: 6px;
        border: 1px solid #dcdcdc;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
        position-area: block-end span-inline-end;
        position-try-order: normal;
        position-try-fallbacks: flip-block;
    }

    .input-box select option {
        padding: 10px 14px;
        border-radius: 6px;
        font-size: 15px;
        font-weight: 500;
        color: #333;
        cursor: pointer;
    }

    .input-box select option::checkmark {
        display: none;
    }

    .input-box select option:hover,
    .input-box select option:focus-visible {
        background: #f6eaea;
        color: var(--primary);
        outline: none;
    }

    .input-box select option:checked {
        background: var(--primary);
        color: #fff;
    }

    .input-box select option[value=""],
    .input-box select option[value=""]:checked {
        background: transparent;
        color: #888;
    }
}


/* Notification box */
.message-box {
    position: fixed;
    top: 20px;
    right: 10px;
    transform: translateX(100%); /* offscreen initially */
    opacity: 0;
    pointer-events: none;
    min-width: 250px;
    max-width: 350px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    background-color: #f44336;
    color: #fff;
}

/* Success variant */
.message-box.success {
    background-color: #4CAF50;
}

/* Keyframe animation for sliding in */
@keyframes slideInRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Keyframe animation for sliding out */
@keyframes slideOutRight {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Show the toast */
.message-box.show {
    pointer-events: auto;
    animation: slideInRight 0.5s forwards;
}

/* Optional: hide animation trigger with JS */
.message-box.hide {
    animation: slideOutRight 0.5s forwards;
}
