@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
    --card: rgba(15, 23, 42, 0.95);
    --input: #020817;
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.22);
    --primary: #38bdf8;
    --primary-dark: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.25), transparent 32%),
        radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.25), transparent 35%),
        linear-gradient(135deg, #020617, #071426);
}

.auth-shell {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 35px 16px;
}

.auth-right {
    width: 100%;
    display: flex;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 520px;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 36px;
    box-shadow: 0 35px 100px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(18px);
}

.brand-box {
    text-align: center;
    margin-bottom: 26px;
}

.brand-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 15px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.38);
}

.brand-box h1 {
    font-size: 29px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.brand-box p {
    color: var(--muted);
    margin-top: 7px;
    font-size: 14px;
}

.form-group {
    width: 100%;
    margin-bottom: 17px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 800;
    color: #e5e7eb;
}

.input-box {
    height: 55px;
    width: 100%;
    display: flex;
    align-items: center;
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: 17px;
    padding: 0 15px;
    transition: 0.25s ease;
}

.input-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.13);
}

.input-box i {
    color: var(--primary);
    width: 20px;
    min-width: 20px;
    margin-right: 11px;
    text-align: center;
}

.input-box input {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 100%;
    border: none;
    outline: none;
    background: transparent !important;
    color: var(--text) !important;
    font-size: 14px;
    font-family: inherit;
    caret-color: var(--primary);
}

.input-box input::placeholder {
    color: #64748b;
}

/* Fix Chrome/Edge autofill white background */
.input-box input:-webkit-autofill,
.input-box input:-webkit-autofill:hover,
.input-box input:-webkit-autofill:focus,
.input-box input:-webkit-autofill:active {
    -webkit-text-fill-color: #f8fafc !important;
    box-shadow: 0 0 0 1000px #020817 inset !important;
    -webkit-box-shadow: 0 0 0 1000px #020817 inset !important;
    transition: background-color 9999s ease-in-out 0s;
    caret-color: #38bdf8;
}

.eye-btn {
    border: none;
    outline: none;
    background: transparent;
    cursor: pointer;
    padding: 5px;
}

.eye-btn i {
    margin: 0;
    color: var(--muted);
}

.form-group small {
    display: block;
    margin-top: 7px;
    font-size: 12px;
    color: var(--muted);
}

.password-meter {
    height: 6px;
    width: 100%;
    margin-top: 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    overflow: hidden;
}

.password-meter span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--danger);
    transition: 0.3s ease;
}

.password-meter.weak span {
    width: 35%;
    background: #ef4444;
}

.password-meter.medium span {
    width: 68%;
    background: #f59e0b;
}

.password-meter.strong span {
    width: 100%;
    background: #22c55e;
}

.submit-btn {
    width: 100%;
    height: 58px;
    border: none;
    border-radius: 18px;
    margin-top: 6px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
    font-family: inherit;
    cursor: pointer;
    transition: 0.25s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 35px rgba(37, 99, 235, 0.35);
}

.submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.85;
}

.btn-loader {
    display: none;
    width: 22px;
    height: 22px;
    margin: auto;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.submit-btn.loading .btn-text {
    display: none;
}

.submit-btn.loading .btn-loader {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-footer {
    text-align: center;
    margin-top: 22px;
    color: var(--muted);
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 900;
}

.toast-message {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.4s ease;
}

.toast-message.success {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.toast-message.error {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.hide-toast {
    opacity: 0;
    transform: translateY(-12px);
    transition: 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-12px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 620px) {
    .auth-shell {
        padding: 20px 14px;
    }

    .auth-card {
        padding: 25px 18px;
        border-radius: 24px;
    }

    .brand-box h1 {
        font-size: 24px;
    }
}

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 999999;
    display: grid;
    gap: 12px;
    width: min(390px, calc(100% - 32px));
}

.toast-popup {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px);
    animation: toastIn 0.35s ease forwards;
    position: relative;
    overflow: hidden;
}

.toast-popup::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    width: 100%;
    animation: toastLine 4.5s linear forwards;
}

.toast-popup.success::after {
    background: #22c55e;
}

.toast-popup.error::after {
    background: #ef4444;
}

.toast-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-popup.success .toast-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

.toast-popup.error .toast-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.toast-content strong {
    display: block;
    font-size: 14px;
    font-weight: 900;
    margin-bottom: 4px;
}

.toast-content span {
    display: block;
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.5;
}

.toast-close {
    margin-left: auto;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 15px;
}

.toast-popup.hide {
    animation: toastOut 0.35s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(30px) translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(35px);
    }
}

@keyframes toastLine {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

@media (max-width: 620px) {
    .toast-container {
        top: 16px;
        right: 16px;
        left: 16px;
        width: auto;
    }
}