:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --accent: #0ea5e9;
    --bg-dark: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.97);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    min-height: 100dvh;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 55%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    overflow-x: hidden;
}

.login-bg-shapes .shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.42;
    z-index: 0;
    pointer-events: none;
    animation: floatBlob 9s infinite alternate ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: #4f46e5;
    top: -80px;
    left: -80px;
}

.shape-2 {
    width: 260px;
    height: 260px;
    background: #0ea5e9;
    bottom: -60px;
    right: -60px;
    animation-delay: 2s;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: cardSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-card {
    background: var(--card-bg);
    border-radius: 22px;
    padding: 32px 26px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
}

.brand-header {
    text-align: center;
    margin-bottom: 24px;
}

.brand-badge {
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff;
    font-weight: 800;
    font-size: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.35);
}

.brand-header h1 {
    font-size: 21px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 0.4px;
}

.brand-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-field {
    text-align: left;
    margin-bottom: 14px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-group label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.input-group input {
    width: 100%;
    padding: 13px 14px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: all 0.2s ease;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper input {
    padding-right: 46px;
}

.toggle-password-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.toggle-password-btn:hover {
    color: var(--primary);
}

.link-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.link-btn:hover {
    text-decoration: underline;
}

.btn-submit {
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(79, 70, 229, 0.55);
}

.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.login-footer {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.login-footer a {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
}

.login-footer a:hover {
    color: var(--primary);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.76);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 14px;
    z-index: 999;
    overflow-y: auto;
}

.modal-backdrop.open {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-box {
    background: #ffffff;
    width: 100%;
    max-width: 390px;
    border-radius: 20px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: popScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    margin: auto;
}

.modal-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #eef2ff;
    color: var(--primary);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}

.modal-box h2 {
    font-size: 19px;
    color: var(--text-main);
    margin-bottom: 8px;
}

.modal-box p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

#otpCodeInput {
    width: 100%;
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 6px;
    padding: 12px 8px;
    border: 2px solid var(--border);
    border-radius: 12px;
    margin-bottom: 14px;
    outline: none;
}

#otpCodeInput:focus {
    border-color: var(--primary);
}

.trust-check {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: #475569;
    margin-bottom: 18px;
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-actions button {
    flex: 1;
}

.btn-cancel {
    padding: 13px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #f1f5f9;
    color: #334155;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.toast-container {
    position: fixed;
    bottom: 16px;
    right: 16px;
    left: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 13px 18px;
    border-radius: 10px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    max-width: 100%;
}

.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }

@media (max-width: 480px) {
    .login-card {
        padding: 26px 18px;
        border-radius: 18px;
    }
    .modal-box {
        padding: 20px 16px;
    }
    #otpCodeInput {
        font-size: 22px;
        letter-spacing: 4px;
    }
    .modal-actions {
        flex-direction: column-reverse;
    }
    .toast-container {
        align-items: stretch;
    }
}

@keyframes floatBlob {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(25px, 20px) scale(1.08); }
}

@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popScale {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
