﻿* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #334155 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    background: #fff;
    padding: 40px 36px 32px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
    width: 400px;
    max-width: 94vw;
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.logo img {
    height: 44px;
    object-fit: contain;
}

.app-title {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 600;
    color: #0F172A;
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

.login-tabs {
    display: flex;
    margin-bottom: 24px;
    background: #F1F5F9;
    border-radius: 10px;
    padding: 3px;
}

.login-tab {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    color: #64748B;
    border-radius: 8px;
    transition: all 0.2s;
}

.login-tab.active {
    background: #fff;
    color: #0F172A;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.82rem;
    color: #334155;
}

.input-group {
    position: relative;
    margin-bottom: 18px;
}

.input-group input {
    width: 100%;
    padding: 10px 36px 10px 36px;
    border-radius: 8px;
    border: 1.5px solid #E2E8F0;
    font-size: 0.88rem;
    color: #0F172A;
    background: #F8FAFC;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
}

.input-group input:focus {
    border-color: #3B82F6;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.input-group input::placeholder { color: #94A3B8; }

.input-group i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 0.9rem;
}

.input-group .icon-left { left: 11px; }
.input-group .icon-right { right: 11px; cursor: pointer; }

.btn-primary {
    width: 100%;
    padding: 11px;
    border: none;
    background: #3B82F6;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary:hover { background: #2563EB; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-secondary {
    width: 100%;
    padding: 11px;
    border: 1.5px solid #E2E8F0;
    background: #fff;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-secondary:hover { background: #F8FAFC; border-color: #CBD5E1; }
.btn-secondary:disabled { opacity: 0.55; cursor: not-allowed; }

#otpSpinner {
    margin: 8px 0;
    font-size: 0.82rem;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 6px;
}

.msg-box {
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 10px;
    text-align: center;
}

.register-link {
    text-align: center;
    margin-top: 16px;
    font-size: 0.82rem;
}

.register-link a {
    color: #3B82F6;
    text-decoration: none;
    font-weight: 500;
}

.register-link a:hover { text-decoration: underline; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(15,23,42,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    padding: 28px;
    border-radius: 14px;
    width: 420px;
    max-width: 94vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    position: relative;
}

.modal-content h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: #0F172A;
}

.modal-content .close {
    position: absolute;
    right: 14px; top: 10px;
    font-size: 1.3rem;
    cursor: pointer;
    color: #94A3B8;
    line-height: 1;
}

.modal-content .close:hover { color: #334155; }

.modal-content textarea {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1.5px solid #E2E8F0;
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
    outline: none;
}

.modal-content textarea:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* OTP form spacing */
.otp-space { margin-top: 14px; }

/* Spacing for message area */
#otpMessage { min-height: 1.2em; }

/* ── Mobile / Small Screen ── */
@media (max-width: 600px) {
    /* Inputs at 16px prevent iOS Safari auto-zoom on focus */
    .input-group input {
        font-size: 16px;
        padding: 12px 36px;
    }

    .login-container {
        padding: 28px 20px 24px;
    }

    .app-title {
        font-size: 1.05rem;
        margin-bottom: 20px;
    }

    .logo {
        margin-bottom: 16px;
    }

    .login-tabs {
        margin-bottom: 20px;
    }

    .login-tab {
        padding: 10px 8px;
        font-size: 0.82rem;
    }

    .btn-primary, .btn-secondary {
        padding: 13px;
        font-size: 0.92rem;
    }

    .modal-content {
        padding: 24px 20px;
    }
}

/* Short viewports: keep the card fully visible instead of clipping the top */
@media (max-height: 560px) {
    body {
        align-items: flex-start;
        padding: 20px 0;
    }
}
