@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;600;700&display=swap');

:root {
    --primary: #4f46e5;
    --primary-glow: rgba(79, 70, 229, 0.4);
    --accent: #22d3ee;

    --bg-dark: #0b1220;
    --glass-bg: rgba(255, 255, 255, 0.06);

    --border: rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.15);

    --text-primary: #ffffff;
    --text-muted: #9aa4b2;

    --bg-dark: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-secondary: #94a3b8;
    --error: #ef4444;
    --success: #10b981;
    --primary-glow: rgba(67, 97, 238, 0.3);
    --input-bg: rgba(255, 255, 255, 0.05);
}

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

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-dark);
    background-image:
        radial-gradient(at 0% 0%, rgba(67, 97, 238, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(76, 201, 240, 0.1) 0px, transparent 50%);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- NAVIGATION --- */
nav {
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 40px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
}

nav h1 {
    font-size: 1.5rem;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* --- MAIN FORM LAYOUT --- */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.container {
    width: 85%;
    max-width: 1000px;
    height: 600px;
    display: flex;
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.sideImg {
    width: 50%;
    background: linear-gradient(45deg, rgba(67, 97, 238, 0.4), rgba(76, 201, 240, 0.5)), url('../assets/sideimg.png');
    background-size: cover;
    background-position: center;
}

/* --- LEFT SIDE: THE FORM --- */
.form-section {
    width: 50%;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-header { margin-bottom: 35px; }
.form-header h2 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.form-header p { color: var(--text-secondary); font-size: 0.95rem; }

.input-group {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.field-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-wrapper label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 4px;
}

input {
    width: 100%;
    height: 52px;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 0 18px;
    color: white;
    font-size: 0.95rem;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.05);
    box-shadow: 0 0 0 4px var(--primary-glow);
}
.password-wrapper {
    position: relative;
    width: 100%;
}

/* Ensure the input doesn't hide text behind the icon */
.password-wrapper input {
    padding-right: 45px;
}

.eye-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    padding: 0;
}

.eye-btn:hover {
    color: var(--primary-color);
}

.eye-btn:focus {
    outline: none;
}

.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.forgot-pass {
    font-size: 0.85rem;
    color: var(--text-light);

}

.submit-btn {
    margin-top: 10px;
    height: 54px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 10px 20px var(--primary-glow);
}

.submit-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.switch-text {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.switch-text a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    margin-left: 5px;
}

/* --- MODAL (Signup Success) --- */
.modalScreen {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    /* Managed by JS */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    width: 90%;
    max-width: 400px;
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 30px;
    position: relative;
    transform: scale(0.9);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* opacity: 0; Managed by JS */
}

.modal .cut {
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
    opacity: 0.5;
    transition: 0.3s;
}

.modal .cut:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.modalContent img {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.modalText p:first-child {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.modalText p:last-child {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.modalContent button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* --- MOBILE OPTIMIZATION --- */
@media (max-width: 1024px) {
    .container {
        width: 95%;
        height: auto;
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    body { height: auto; min-height: 100vh; overflow-y: auto; }
    nav { padding: 0 20px; }
    
    main { padding: 40px 10px; }
    
    .container {
        flex-direction: column;
        height: auto;
        border-radius: 24px;
        width: 100%;
        max-width: 450px;
    }

    .sideImg {
        display: none;
    }

    .form-section {
        width: 100%;
        padding: 40px 25px;
    }

    .form-header h2 { font-size: 1.7rem; }
    .submit-btn { height: 50px; }
}

@media (max-width: 480px) {
    .form-section { padding: 30px 20px; }
    .otp-box { width: 42px; height: 52px; font-size: 1.2rem; }
}

/* --- OTP SECTION --- */
.otp-section {
    display: none;
    flex-direction: column;
    width: 100%;
}

.otp-input-wrapper {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 25px 0 35px;
}

.otp-box {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--input-bg);
    color: white;
    transition: all 0.3s ease;
    padding: 0;
}

.otp-box:focus {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.1);
    box-shadow: 0 0 0 4px var(--primary-glow);
    outline: none;
}

#otpCountdown {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
}

#errorText {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 12px;
    background: rgba(239, 68, 68, 0.1);
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: none;
    font-weight: 600;
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    min-width: 300px;
    background: #1e293b;
    padding: 16px 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-left: 6px solid #475569;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: toastSlideIn 0.4s ease-out;
}

.toast-success { border-left-color: var(--success); }
.toast-success i { color: var(--success); }
.toast-error { border-left-color: var(--error); }
.toast-error i { color: var(--error); }

.toast span {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}