/* =============================================
   CFL Authentication Styles
   Indian Army - Composite Food Laboratory
   ============================================= */

:root {
    --navy-deep: #0d1b3e;
    --navy-primary: #1a2d5a;
    --navy-light: #2a4073;
    --gold-primary: #d4a84b;
    --gold-light: #e8c97a;
    --gold-bright: #ffd700;
    --cream: #f8f6f0;
    --white: #ffffff;
    --gray-100: #f5f5f5;
    --gray-300: #e0e0e0;
    --gray-500: #737373;
    --gray-600: #6b7280;
    --success: #22c55e;
    --error: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    display: flex;
    background: var(--cream);
}

/* =============================================
   LEFT PANEL - LOGIN
   ============================================= */
.login-panel {
    flex: 0 0 42%;
    height: 100vh;
    background: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 3rem;
    position: relative;
    z-index: 2;
    box-shadow: 4px 0 60px rgba(13, 27, 62, 0.1);
}

.login-container {
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.8s ease-out;
}

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

/* =============================================
   EMBLEM SECTION
   ============================================= */
.emblem-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.emblem-image {
    width: 100px;
    height: auto;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 4px 12px rgba(26, 45, 90, 0.15));
}

.org-title {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--navy-primary);
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.org-subtitle {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* =============================================
   WELCOME SECTION
   ============================================= */
.welcome-section {
    margin-bottom: 1.25rem;
}

.welcome-title {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--navy-deep);
    margin-bottom: 0.25rem;
}

.welcome-subtitle {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* =============================================
   LOGIN TYPE TABS
   ============================================= */
.login-tabs {
    display: flex;
    background: var(--gray-100);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 1.25rem;
}

.login-tab {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.login-tab.active {
    background: var(--white);
    color: var(--navy-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.login-tab:hover:not(.active) {
    color: var(--navy-primary);
}

/* =============================================
   FORM STYLES
   ============================================= */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--navy-primary);
    letter-spacing: 0.02em;
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--navy-primary);
    box-shadow: 0 0 0 3px rgba(26, 45, 90, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--gray-500);
}

.error-message {
    font-size: 0.75rem;
    color: var(--error);
    display: none;
}

.error-message.show {
    display: block;
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.forgot-link {
    font-size: 0.85rem;
    color: var(--gold-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--navy-primary);
}

/* =============================================
   OTP SECTION
   ============================================= */
.otp-section {
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.otp-section.active {
    display: block;
}

.otp-info {
    background: var(--gray-100);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.otp-info-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--navy-primary), var(--navy-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
}

.otp-info-icon svg {
    width: 24px;
    height: 24px;
    color: var(--white);
}

.otp-info-title {
    font-weight: 600;
    color: var(--navy-deep);
    margin-bottom: 0.25rem;
}

.otp-info-text {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.otp-info-text strong {
    color: var(--navy-primary);
}

/* OTP Input Boxes */
.otp-inputs {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.otp-input {
    width: 50px;
    height: 56px;
    border: 2px solid var(--gray-300);
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    font-family: 'Cinzel', serif;
    color: var(--navy-primary);
    transition: all 0.2s ease;
}

.otp-input:focus {
    outline: none;
    border-color: var(--navy-primary);
    box-shadow: 0 0 0 3px rgba(26, 45, 90, 0.1);
}

.otp-input.filled {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.05);
}

.otp-input.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.05);
}

/* Resend OTP */
.otp-resend {
    text-align: center;
    margin-bottom: 1rem;
}

.otp-timer {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.otp-timer strong {
    color: var(--navy-primary);
    font-weight: 600;
}

.resend-btn {
    background: none;
    border: none;
    color: var(--gold-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
}

.resend-btn:disabled {
    color: var(--gray-500);
    cursor: not-allowed;
    text-decoration: none;
}

.resend-btn:not(:disabled):hover {
    color: var(--navy-primary);
}

/* Change Method Link */
.change-method {
    text-align: center;
    margin-top: 1rem;
}

.change-method-link {
    font-size: 0.85rem;
    color: var(--gray-600);
    text-decoration: none;
    cursor: pointer;
}

.change-method-link:hover {
    color: var(--navy-primary);
}

/* Remember Device */
.remember-device {
    margin: 1rem 0;
    text-align: center;
}

.remember-device-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.remember-device-label input {
    width: 16px;
    height: 16px;
    accent-color: var(--navy-primary);
    cursor: pointer;
}

.remember-device-label:hover {
    color: var(--navy-primary);
}

/* =============================================
   BUTTON STYLES
   ============================================= */
.btn-primary {
    margin-top: 0.5rem;
    padding: 0.85rem;
    background: linear-gradient(135deg, var(--navy-primary), var(--navy-deep));
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 168, 75, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 45, 90, 0.25);
}

.btn-primary:hover::before {
    left: 100%;
}

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

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

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-primary.loading .btn-text {
    display: none;
}

.btn-primary.loading .btn-loader {
    display: inline-block;
}

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

.btn-secondary {
    padding: 0.75rem;
    background: var(--white);
    color: var(--navy-primary);
    border: 1.5px solid var(--navy-primary);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-secondary:hover {
    background: var(--navy-primary);
    color: var(--white);
}

/* =============================================
   FOOTER & SECURITY BADGE
   ============================================= */
.login-footer {
    margin-top: 1.25rem;
    text-align: center;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--gray-100);
    border-radius: 6px;
}

.security-icon {
    width: 16px;
    height: 16px;
    color: var(--success);
}

.security-text {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* =============================================
   RIGHT PANEL - PROMOTIONAL
   ============================================= */
.promo-panel {
    flex: 1;
    height: 100vh;
    background: linear-gradient(145deg, var(--navy-deep) 0%, var(--navy-primary) 50%, var(--navy-light) 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    overflow: hidden;
}

.promo-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 150%;
    background: radial-gradient(circle, rgba(212, 168, 75, 0.08) 0%, transparent 60%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.geometric-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(212, 168, 75, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 168, 75, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

.corner-accent {
    position: absolute;
    width: 150px;
    height: 150px;
    border: 2px solid rgba(212, 168, 75, 0.15);
}

.corner-accent.top-right {
    top: 2rem;
    right: 2rem;
    border-left: none;
    border-bottom: none;
}

.corner-accent.bottom-left {
    bottom: 2rem;
    left: 2rem;
    border-right: none;
    border-top: none;
}

.promo-content {
    position: relative;
    z-index: 2;
    max-width: 550px;
    animation: fadeInRight 1s ease-out 0.3s both;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.shield-icon {
    width: 70px;
    height: 80px;
    margin-bottom: 1.5rem;
}

.shield-svg {
    width: 100%;
    height: 100%;
}

.promo-tagline {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--gold-primary);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.promo-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.promo-title span {
    color: var(--gold-light);
}

.promo-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin-bottom: 2rem;
    font-weight: 300;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.stat-item {
    text-align: left;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(212, 168, 75, 0.1);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(212, 168, 75, 0.25);
    transform: translateY(-4px);
}

.stat-value {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--gold-light);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.motto-ribbon {
    position: absolute;
    bottom: 2rem;
    right: 4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 2;
}

.motto-line {
    width: 50px;
    height: 1px;
    background: var(--gold-primary);
}

.motto-text {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--gold-primary);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* =============================================
   RESPONSIVE STYLES
   ============================================= */
@media (max-width: 1200px) {
    .promo-title {
        font-size: 2rem;
    }
    .stat-value {
        font-size: 1.8rem;
    }
    .promo-panel {
        padding: 2rem 3rem;
    }
}

@media (max-width: 992px) {
    html, body {
        height: auto;
        overflow: auto;
    }
    body {
        flex-direction: column;
    }
    .login-panel {
        flex: none;
        height: auto;
        min-height: 100vh;
        padding: 2rem;
    }
    .promo-panel {
        height: auto;
        min-height: 60vh;
        padding: 2rem;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .promo-title {
        font-size: 1.6rem;
    }
    .corner-accent {
        display: none;
    }
    .otp-input {
        width: 44px;
        height: 50px;
        font-size: 1.25rem;
    }
}
