/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --primary-dark: #1d4ed8;
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --dark: #1f2937;
    --light: #f9fafb;
    --gray: #6b7280;
    --border: #e5e7eb;
}

/* ===== BODY - Full screen on mobile ===== */
body {
    background: linear-gradient(135deg, #dfe1e6 0%, #e5e6e8 50%, #dbeafe 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* ===== CONTAINER ===== */
.login-container {
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #1d4ed8, #dbeafe, #2563eb);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* ===== LOGO HEADER ===== */
.logo-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    padding: 30px 20px 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.logo-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.logo-header .logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.logo-header .logo-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.logo-header .logo-image {
    height: 60px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    background: transparent;
    padding: 0;
    border: none;
    flex-shrink: 0;
    display: block;
}

.logo-header .logo-image.hidden {
    display: none !important;
}

.logo-header .logo-icon.hidden {
    display: none !important;
}

.logo-header .logo-text {
    text-align: left;
}

.logo-header .logo-text h1 {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo-header .logo-text .subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 400;
    margin-top: 2px;
    letter-spacing: 1px;
}

/* Decorative circles in logo header */
.logo-header .deco-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.logo-header .deco-circle.c1 {
    width: 150px;
    height: 150px;
    top: -60px;
    right: -40px;
}

.logo-header .deco-circle.c2 {
    width: 100px;
    height: 100px;
    bottom: -30px;
    left: -30px;
}

.logo-header .deco-circle.c3 {
    width: 70px;
    height: 70px;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
}

/* ===== RIGHT PANEL ===== */
.right-panel {
    padding: 35px 35px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ===== FORM HEADER ===== */
.form-header {
    margin-bottom: 24px;
    text-align: center;
    position: relative;
}

.form-header h2 {
    font-size: 22px;
    color: var(--dark);
    margin-bottom: 4px;
    font-weight: 600;
}

.form-header p {
    color: var(--gray);
    font-size: 14px;
}

/* ===== LOGIN METHOD TABS ===== */
/* Horizontal (icon + text side-by-side) on every device.
   - Phone commented  → single Email tab fills width & centers.
   - Phone uncommented → two tabs split 50/50.               */
.login-method-tabs {
    display: flex;
    background: var(--light);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    gap: 4px;
    justify-content: center;
    align-items: center;
}

.login-method-tab {
    flex: 1 1 0;
    max-width: 100%;
    padding: 12px 8px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    color: var(--gray);
    font-size: 14px;
    display: flex;
    flex-direction: row;        /* icon left, text right — everywhere */
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    background: transparent;
    min-height: 52px;
    line-height: 1.2;
}

/* When only ONE tab is present (e.g. phone tab commented out) */
.login-method-tab:only-child {
    flex: 1 1 100%;
    max-width: 100%;
}

.login-method-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-method-tab i {
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-method-tab span {
    display: inline-block;
    line-height: 1.2;
}

/* ===== FORM STYLES ===== */
.login-form {
    margin-top: 4px;
}

.login-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.login-step.active {
    display: block;
}

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

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    pointer-events: none;
}

.input-with-icon input {
    width: 100%;
    padding: 14px 16px 14px 45px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    background: white;
    -webkit-appearance: none;
    appearance: none;
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: normal;
    color: var(--gray);
    cursor: pointer;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* ===== BUTTONS ===== */
.btn {
    width: 100%;
    padding: 14px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 16px;
    position: relative;
    overflow: hidden;
    min-height: 52px;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-outline {
    background-color: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary-light);
}

.btn-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== OTP SECTION ===== */
.otp-section {
    text-align: center;
}

.otp-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 18px 0;
    flex-wrap: wrap;
}

.otp-input {
    width: 45px;
    height: 55px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 22px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s;
    background: white;
    -webkit-appearance: none;
    appearance: none;
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.otp-input.filled {
    border-color: var(--primary);
}

.otp-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.otp-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* ===== MESSAGE STYLES ===== */
.error-message, .success-message, .info-message, .warning-message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    display: none;
    align-items: center;
    gap: 10px;
}

.error-message { background: var(--danger-light); color: var(--danger); }
.success-message { background: var(--success-light); color: var(--success); }
.info-message { background: var(--primary-light); color: var(--primary); }
.warning-message { background: var(--warning-light); color: var(--warning); }

/* ===== REGISTER SECTION ===== */
.register-section {
    text-align: center;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.register-text {
    color: var(--gray);
    margin-bottom: 14px;
    font-size: 15px;
}

.register-btn {
    background-color: var(--light);
    color: var(--dark);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    width: 100%;
}

.register-btn:hover {
    background-color: #e5e7eb;
    border-color: var(--gray);
}

/* ===== FOOTER LINKS ===== */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
    font-size: 13px;
    color: var(--gray);
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--gray);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 20px;
    color: var(--dark);
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
    padding: 4px 8px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.modal-footer .btn {
    flex: 1;
    min-width: 100px;
}

/* ============================================================
   RESPONSIVE - FULL SCREEN ON MOBILE
   ============================================================ */

/* ----- Small devices (phones, 576px and below) ----- */
@media (max-width: 576px) {
    body {
        padding: 0;
        align-items: stretch;
        min-height: 100vh;
        min-height: 100dvh;
        background: white;
    }

    body::before {
        display: none;
    }

    .login-container {
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        background: white;
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
    }

    .login-container::before {
        height: 3px;
        border-radius: 0;
    }

    .logo-header {
        padding: 20px 16px 18px;
        flex-shrink: 0;
    }

    .logo-header .logo-wrapper {
        gap: 12px;
    }

    .logo-header .logo-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
        border-radius: 12px;
    }

    .logo-header .logo-image {
        height: 48px;
        width: auto;
        max-width: 150px;
    }

    .logo-header .logo-text h1 {
        font-size: 22px;
    }

    .logo-header .logo-text .subtitle {
        font-size: 11px;
    }

    .logo-header .deco-circle.c1 {
        width: 100px;
        height: 100px;
        top: -40px;
        right: -30px;
    }

    .logo-header .deco-circle.c2 {
        width: 70px;
        height: 70px;
        bottom: -20px;
        left: -20px;
    }

    .logo-header .deco-circle.c3 {
        width: 50px;
        height: 50px;
    }

    .right-panel {
        padding: 20px 16px 24px;
        flex: 1;
        overflow-y: auto;
    }

    .form-header {
        margin-bottom: 16px;
    }

    .form-header h2 {
        font-size: 20px;
    }

    .form-header p {
        font-size: 13px;
    }

    .login-method-tabs {
        padding: 4px;
        margin-bottom: 18px;
        border-radius: 10px;
    }

    /* keep horizontal — just tighten spacing */
    .login-method-tab {
        padding: 10px 8px;
        font-size: 13px;
        gap: 7px;
        border-radius: 6px;
        min-height: 48px;
    }

    .login-method-tab i {
        font-size: 16px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    label {
        font-size: 13px;
        margin-bottom: 5px;
    }

    .input-with-icon input {
        padding: 12px 14px 12px 40px;
        font-size: 14px;
        border-radius: 8px;
        min-height: 48px;
    }

    .input-with-icon i {
        left: 14px;
        font-size: 14px;
    }

    .options-row {
        margin-bottom: 18px;
        gap: 8px;
    }

    .checkbox-group label {
        font-size: 13px;
    }

    .forgot-password {
        font-size: 13px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 48px;
        border-radius: 10px;
    }

    .otp-inputs {
        gap: 8px;
        margin: 14px 0;
    }

    .otp-input {
        width: 40px;
        height: 48px;
        font-size: 20px;
        border-radius: 8px;
    }

    .otp-actions {
        flex-direction: column;
        gap: 8px;
        margin-top: 14px;
    }

    .otp-actions .btn {
        min-width: 100%;
    }

    .error-message, .success-message, .info-message, .warning-message {
        padding: 10px 14px;
        font-size: 13px;
        margin-bottom: 14px;
        border-radius: 8px;
    }

    .register-section {
        margin-top: 18px;
        padding-top: 18px;
    }

    .register-text {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .register-btn {
        padding: 10px 20px;
        font-size: 14px;
        border-radius: 8px;
    }

    .footer-links {
        gap: 10px;
        font-size: 12px;
        margin-top: 18px;
        flex-direction: column;
        align-items: center;
    }

    .modal {
        padding: 12px;
    }

    .modal-content {
        padding: 20px 16px;
        border-radius: 12px;
        margin: 0;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        min-width: 100%;
    }
}

/* ----- Extra small phones (380px and below) ----- */
@media (max-width: 380px) {
    .logo-header {
        padding: 16px 12px 14px;
    }

    .logo-header .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
        border-radius: 10px;
    }

    .logo-header .logo-image {
        height: 40px;
        width: auto;
        max-width: 120px;
    }

    .logo-header .logo-text h1 {
        font-size: 18px;
    }

    .logo-header .logo-text .subtitle {
        font-size: 10px;
    }

    .right-panel {
        padding: 16px 12px 18px;
    }

    .form-header h2 {
        font-size: 18px;
    }

    .input-with-icon input {
        padding: 10px 12px 10px 36px;
        font-size: 13px;
        min-height: 42px;
    }

    .input-with-icon i {
        left: 12px;
        font-size: 13px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 42px;
    }

    .otp-input {
        width: 34px;
        height: 42px;
        font-size: 18px;
    }

    .otp-inputs {
        gap: 6px;
    }

    /* still horizontal, just smaller */
    .login-method-tab {
        font-size: 12px;
        padding: 8px 6px;
        gap: 6px;
        min-height: 44px;
    }

    .login-method-tab i {
        font-size: 14px;
    }
}

/* ----- Landscape phones (max-height: 500px) ----- */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 0;
        align-items: stretch;
    }

    .login-container {
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
        min-height: 100dvh;
        background: white;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .logo-header {
        padding: 12px 20px;
        width: 100%;
        flex-shrink: 0;
    }

    .logo-header .logo-wrapper {
        gap: 10px;
    }

    .logo-header .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
        border-radius: 10px;
    }

    .logo-header .logo-image {
        height: 36px;
        width: auto;
        max-width: 100px;
    }

    .logo-header .logo-text h1 {
        font-size: 18px;
    }

    .logo-header .logo-text .subtitle {
        font-size: 10px;
    }

    .logo-header .deco-circle {
        display: none;
    }

    .right-panel {
        padding: 12px 20px 16px;
        flex: 1;
        overflow-y: auto;
        max-height: calc(100vh - 80px);
    }

    .form-header {
        margin-bottom: 10px;
    }

    .form-header h2 {
        font-size: 17px;
    }

    .form-header p {
        font-size: 12px;
    }

    .login-method-tabs {
        margin-bottom: 10px;
        padding: 3px;
    }

    /* still horizontal, compact */
    .login-method-tab {
        padding: 6px 8px;
        font-size: 12px;
        gap: 6px;
        min-height: 38px;
    }

    .login-method-tab i {
        font-size: 13px;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .input-with-icon input {
        padding: 8px 12px 8px 34px;
        font-size: 13px;
        min-height: 36px;
    }

    .options-row {
        margin-bottom: 12px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 13px;
        min-height: 36px;
    }

    .otp-inputs {
        margin: 10px 0;
        gap: 6px;
    }

    .otp-input {
        width: 34px;
        height: 38px;
        font-size: 16px;
    }

    .otp-actions {
        margin-top: 10px;
        flex-direction: row;
    }

    .otp-actions .btn {
        min-width: 80px;
        padding: 8px 12px;
    }

    .register-section {
        margin-top: 12px;
        padding-top: 12px;
    }

    .register-text {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .register-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .footer-links {
        margin-top: 12px;
        gap: 10px;
        font-size: 11px;
        flex-direction: row;
    }

    .error-message, .success-message, .info-message, .warning-message {
        padding: 6px 12px;
        font-size: 12px;
        margin-bottom: 10px;
    }
}

/* ----- Tablet (577px - 768px) ----- */
@media (min-width: 577px) and (max-width: 768px) {
    body {
        padding: 16px;
    }

    .login-container {
        max-width: 440px;
        border-radius: 20px;
    }

    .logo-header {
        padding: 28px 24px 24px;
    }

    .logo-header .logo-icon {
        width: 54px;
        height: 54px;
        font-size: 28px;
    }

    .logo-header .logo-image {
        height: 54px;
        width: auto;
        max-width: 180px;
    }

    .logo-header .logo-text h1 {
        font-size: 26px;
    }

    .right-panel {
        padding: 30px 28px 28px;
    }

    .otp-input {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }
}

/* ----- Large screens (1200px+) ----- */
@media (min-width: 1200px) {
    .login-container {
        max-width: 520px;
    }

    .logo-header {
        padding: 35px 30px 30px;
    }

    .logo-header .logo-icon {
        width: 68px;
        height: 68px;
        font-size: 36px;
        border-radius: 18px;
    }

    .logo-header .logo-image {
        height: 68px;
        width: auto;
        max-width: 220px;
    }

    .logo-header .logo-text h1 {
        font-size: 32px;
    }

    .right-panel {
        padding: 40px 45px 35px;
    }

    .form-header h2 {
        font-size: 24px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: white;
        padding: 20px;
    }
    .login-container {
        box-shadow: none;
        border: 1px solid #ddd;
        border-radius: 12px;
    }
    .login-container::before {
        display: none;
    }
    .logo-header {
        background: #1e3a5f !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .btn, .register-btn {
        background: #f0f0f0 !important;
        color: #333 !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}