* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Top Banner */
.header {
    width: 100%;
    max-width: 480px;
    position: relative;
    background: #0a0e1a;
    overflow: hidden;
}

.header-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.uptime {
    position: absolute;
    top: 12px;
    right: 14px;
    color: rgba(255,255,255,0.75);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.3px;
    z-index: 2;
}

/* Main Form Card */
.login-wrapper {
    width: 100%;
    max-width: 480px;
    background: #f5f5f5;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px 30px;
    margin-top: -28px;
    position: relative;
    z-index: 5;
}

.login-card {
    width: 100%;
    background: #ffffff;
    border-radius: 18px;
    padding: 22px 20px 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 18px;
}

.input-group {
    margin-bottom: 14px;
    position: relative;
}

.input-group input {
    width: 100%;
    height: 50px;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    padding: 0 16px;
    font-size: 15px;
    color: #222;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: #1a73e8;
}

.input-group input::placeholder {
    color: #b0b0b0;
    font-weight: 400;
}

.phone-field {
    display: flex;
    align-items: center;
    height: 50px;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    padding: 0 14px;
    transition: border-color 0.2s;
}

.phone-field:focus-within {
    border-color: #1a73e8;
}

.phone-prefix {
    color: #333;
    font-size: 15px;
    font-weight: 500;
    margin-right: 8px;
    white-space: nowrap;
}

.phone-divider {
    width: 1px;
    height: 22px;
    background: #ddd;
    margin-right: 10px;
}

.phone-field input {
    border: none !important;
    height: 100%;
    padding: 0;
    flex: 1;
    font-size: 15px;
    background: transparent;
}

.phone-field input:focus {
    outline: none;
}

/* Options row */
.options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0 14px;
    padding: 0 2px;
}

.register-link {
    color: #333;
    font-size: 14px;
    text-decoration: underline;
    font-weight: 400;
}

.register-link:hover {
    color: #1a73e8;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="radio"],
.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1a73e8;
    cursor: pointer;
}

/* Privacy */
.privacy-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 0 2px;
}

.privacy-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1a73e8;
    cursor: pointer;
    flex-shrink: 0;
}

.privacy-row label {
    font-size: 13px;
    color: #888;
    cursor: pointer;
    line-height: 1.3;
}

.privacy-row a {
    color: #555;
    text-decoration: underline;
}

/* Buttons */
.btn-login {
    width: 100%;
    height: 50px;
    background: #1a73e8;
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-bottom: 16px;
}

.btn-login:hover {
    background: #1557b0;
}

.btn-login:active {
    transform: scale(0.98);
}

.btn-login:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

.btn-forget {
    width: 100%;
    height: 46px;
    background: transparent;
    border: 1.5px solid #1a73e8;
    border-radius: 25px;
    color: #1a73e8;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-forget:hover {
    background: rgba(26,115,232,0.06);
}

/* Version */
.version {
    margin-top: auto;
    padding: 20px 0 10px;
    font-size: 12px;
    color: #bbb;
    text-align: center;
    width: 100%;
    max-width: 480px;
}

/* ========== OTP Modal ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.otp-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 340px;
    padding: 22px 20px 20px;
    position: relative;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.otp-modal .close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.otp-modal .close-btn:hover {
    color: #333;
}

.otp-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
    padding-right: 30px;
}

.otp-desc {
    font-size: 13.5px;
    color: #777;
    margin-bottom: 6px;
    line-height: 1.4;
}

.otp-sent {
    font-size: 13.5px;
    color: #555;
    margin-bottom: 16px;
}

.otp-sent strong {
    color: #222;
    font-weight: 600;
}

.otp-input-wrap {
    margin-bottom: 8px;
}

.otp-input-wrap input {
    width: 100%;
    height: 48px;
    border: 1.5px solid #e0e0e0;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.otp-input-wrap input:focus {
    border-color: #1a73e8;
}

.otp-input-wrap input::placeholder {
    color: #b0b0b0;
}

.send-otp-link {
    display: block;
    text-align: right;
    color: #1a73e8;
    font-size: 13.5px;
    margin-bottom: 16px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

.send-otp-link:hover {
    text-decoration: underline;
}

.btn-confirm {
    width: 100%;
    height: 48px;
    background: #1a73e8;
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-confirm:hover {
    background: #1557b0;
}

.btn-confirm:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

/* Error / success messages */
.msg {
    font-size: 13px;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    display: none;
}

.msg.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    display: block;
}

.msg.success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
    display: block;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* Responsive */
@media (max-width: 400px) {
    .login-card {
        padding: 18px 16px 16px;
    }
    .otp-modal {
        max-width: 100%;
    }
}
