*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: "Inter", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(46, 167, 219, 0.12), transparent 32%),
        linear-gradient(180deg, #f5f8fc 0%, #eef3f9 100%);
    color: #111827;
}

/* =========================
   AUTH LAYOUT
========================= */
.auth-wrapper {
    display: flex;
    min-height: 100svh;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

/* LEFT */
.auth-left {
    flex: 1;
    width: 100%;
    max-width: 100%;
    background: linear-gradient(135deg, #1f5faf, #2ea7db);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-left::before,
.auth-left::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-left::before {
    width: 320px;
    height: 320px;
    top: -110px;
    left: -90px;
}

.auth-left::after {
    width: 240px;
    height: 240px;
    right: -70px;
    bottom: -85px;
}

.auth-left-content {
    text-align: center;
    padding: 48px;
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 1;
}

.auth-left-content .logo {
    width: 78px;
    margin-bottom: 20px;
}

.auth-left-content h2 {
    margin: 0 0 14px;
    font-size: clamp(1.8rem, 2vw, 2.4rem);
    line-height: 1.2;
}

.auth-left-content p {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
}

/* RIGHT */
.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

/* BOX */
.auth-box {
    width: 100%;
    max-width: 430px;
    min-width: 0;
    margin-inline: auto;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.96);
    padding: 30px 28px 24px;
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
    overflow-x: hidden;
}

.auth-box *,
.auth-box *::before,
.auth-box *::after,
.auth-box form,
.auth-box input,
.auth-box select,
.auth-box textarea,
.auth-box button,
.auth-box a,
.auth-box label,
.auth-box span,
.auth-box small,
.auth-box p,
.auth-box div {
    box-sizing: border-box;
    max-width: 100%;
}

.auth-box form {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.auth-box h3 {
    margin: 0 0 6px;
    font-size: 1.7rem;
    line-height: 1.2;
}

.auth-box p {
    color: #6b7280;
    margin: 0 0 20px;
    line-height: 1.6;
}

/* LOGO */
.auth-logo {
    text-align: center;
    margin-bottom: 18px;
}

.auth-logo img {
    width: 60px;
}

/* FORM */
.form-group {
    margin-bottom: 18px;
    width: 100%;
    min-width: 0;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
    display: block;
}

.form-group input,
.form-group select,
.form-group textarea {
    display: block;
    width: 100%;
    min-height: 46px;
    border-radius: 12px;
    border: 1px solid #dbe3ee;
    padding: 0 14px;
    font: inherit;
    color: #111827;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1f5faf;
    box-shadow: 0 0 0 4px rgba(31, 95, 175, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9ca3af;
}

/* BUTTON */
.btn-login {
    display: block;
    width: 100%;
    min-height: 46px;
    margin-bottom: 5px;
    border: none;
    border-radius: 12px;
    background: #1f5faf;
    color: #fff;
    font: inherit;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-login:hover {
    background: #f4c20d;
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(244, 194, 13, 0.18);
}

.btn-login:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-login.is-loading,
.btn-login.is-loading:hover {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #1f5faf;
    color: #fff;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.btn-login.is-loading:disabled {
    opacity: 0.95;
}

.btn-login-spinner {
    width: 16px;
    height: 16px;
    display: inline-block;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-login-spin 0.75s linear infinite;
}

@keyframes btn-login-spin {
    to {
        transform: rotate(360deg);
    }
}

/* PASSWORD TOGGLE */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.password-wrapper input {
    width: 100%;
    padding-right: 42px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
}

.toggle-password:hover {
    color: #1f5faf;
}

/* EXTRA */
.form-extra {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    margin-bottom: 15px;
}

.form-extra label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4b5563;
}

.form-extra input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.form-extra a,
.auth-bottom a {
    color: #1f5faf;
    font-weight: 600;
    text-decoration: none;
}

.form-extra a:hover,
.auth-bottom a:hover {
    text-decoration: underline;
}

/* ALERTS */
.alert-error {
    background: #fee2e2;
    color: #b91c1c;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.alert-success {
    background: #e6f9f0;
    color: #0f5132;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 14px;
}

.auth-bottom {
    margin: 18px 0 0;
    text-align: center;
    font-size: 14px;
}

.auth-footer {
    margin-top: 18px;
    text-align: center;
    padding-top: 10px;
    font-size: 12px;
    color: #999;
}

.text-muted {
    color: #6b7280;
}

.d-block {
    display: block;
}

.d-none {
    display: none;
}

/* RESPONSIVE */
@media (max-width: 991.98px) {
    .auth-wrapper {
        flex-direction: column;
    }

    .auth-left {
        min-height: 240px;
        flex: 0 0 auto;
    }

    .auth-right {
        width: 100%;
        padding: 20px 16px 24px;
    }

    .auth-box {
        width: 100%;
        max-width: 520px;
        margin-inline: auto;
    }
}

@media (max-width: 575.98px) {
    .auth-left {
        display: none;
    }

    .auth-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px 0;
    }

    .auth-right {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: calc(100svh - 32px);
        padding: 16px 12px;
    }

    .auth-box {
        width: calc(100% - 0px);
        max-width: calc(100vw - 24px);
        padding: 22px 18px 18px;
        border-radius: 18px;
        margin: auto;
    }

    .auth-box h3 {
        font-size: 1.45rem;
    }

    .auth-box p {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .form-group label,
    .form-extra,
    .auth-bottom {
        font-size: 12.5px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea,
    .btn-login {
        min-height: 44px;
        font-size: 14px;
    }

    .toggle-password {
        right: 10px;
    }

    .auth-footer {
        margin-top: 14px;
        padding-top: 6px;
    }
}

.footer-link {
    color: #999;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #1f5faf;
}
