/* auth.css - Login & Authentication Page Styles */

/* ==========================================
   Login Body
   ========================================== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
    background-color: #040c05;
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 50%, rgba(45,122,79,0.07) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(45,122,79,0.04) 0%, transparent 60%);
}

/* ==========================================
   Auth Container (Glass Card)
   ========================================== */
.auth-container {
    width: 100%;
    max-width: 980px;
    min-height: 660px;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    border-radius: 20px;
    position: relative;
    z-index: 10;
    background: rgba(6, 16, 8, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(45,122,79,0.22);
    box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(45,122,79,0.06) inset;
}

/* ==========================================
   Left Panel
   ========================================== */
.left-panel {
    width: 41.666%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.left-panel-bg {
    background:
        linear-gradient(160deg, rgba(45,122,79,0.10) 0%, rgba(3,10,3,0.0) 100%);
    background-image:
        linear-gradient(160deg, rgba(45,122,79,0.10) 0%, rgba(3,10,3,0.0) 100%),
        radial-gradient(circle at 50% 40%, rgba(45,122,79,0.12) 0%, transparent 65%);
}

.left-panel-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.logo-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 4rem 0;
    position: relative;
}

.logo-wrapper::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(45,122,79,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.logo-wrapper img {
    height: 10rem;
    width: auto;
    object-fit: contain;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 24px rgba(45,122,79,0.25));
}

.brand-info {
    margin-top: 1rem;
}

.brand-info h2 {
    color: rgba(255, 255, 255, 0.90);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

.brand-info .brand-tag {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--primary-color, #2d7b4f);
    opacity: 0.8;
    margin: 0;
}

/* Decorative corner accents on left panel */
.lp-decor-tl {
    position: absolute;
    top: 0;
    left: 0;
    width: 120px;
    height: 120px;
    border-top: 1px solid rgba(45,122,79,0.2);
    border-left: 1px solid rgba(45,122,79,0.2);
    border-radius: 20px 0 0 0;
    pointer-events: none;
}

.lp-decor-br {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-bottom: 1px solid rgba(45,122,79,0.12);
    border-right: 1px solid rgba(45,122,79,0.12);
    border-radius: 0 0 0 0;
    pointer-events: none;
}

.left-panel-bottom {
    margin-top: auto;
    padding-top: 2rem;
}

/* Version Badge / Pill */
.version-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.70);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.version-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color, #2d7b4f);
    box-shadow: 0 0 8px var(--primary-color, #2d7b4f);
    animation: pulse-dot 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* ==========================================
   Right Panel
   ========================================== */
.right-panel {
    width: 58.333%;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.right-panel-bg {
    background: rgba(3, 10, 3, 0.2);
}

/* ==========================================
   Form Header
   ========================================== */
.form-header {
    margin-bottom: 2.5rem;
}

.form-eyebrow {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--primary-color, #2d7b4f);
    margin-bottom: 0.5rem;
    display: block;
}

.form-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-white, #ffffff);
    margin-bottom: 0;
    line-height: 1.2;
}

/* ==========================================
   Form Fields
   ========================================== */
#loginForm {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.form-label {
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-left: 0.25rem;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.25rem;
}

.forgot-link {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(45, 122, 79, 0.8);
    text-decoration: none;
    transition: color 0.2s ease;
    letter-spacing: 0.05em;
}

.forgot-link:hover {
    color: var(--primary-color, #2d7b4f);
}

/* Input Wrapper with icon */
.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    pointer-events: none;
    color: rgba(255, 255, 255, 0.20);
    font-size: 1.125rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.input-wrapper:focus-within .input-icon {
    color: var(--primary-color, #2d7b4f);
}

.form-input {
    width: 100%;
    height: 3.5rem;
    background-color: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(45,122,79,0.12);
    border-radius: 0.75rem;
    padding-left: 3rem;
    padding-right: 1rem;
    font-size: 0.9375rem;
    color: var(--text-white, #ffffff);
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.10);
}

.form-input:focus {
    background-color: rgba(45,122,79,0.06);
    border-color: rgba(45,122,79,0.6);
    box-shadow: 0 0 0 3px rgba(45,122,79,0.12);
}

/* Invalid / Error state */
.form-input.is-invalid {
    border-color: rgba(239, 68, 68, 0.7);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.5);
    background-color: rgba(239, 68, 68, 0.04);
}

.form-input.is-invalid:focus {
    border-color: rgba(239, 68, 68, 0.9);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

.input-wrapper:has(.is-invalid) .input-icon {
    color: rgba(239, 68, 68, 0.7);
}

/* Floating error badge on input border */
.input-wrapper {
    position: relative;
}

.input-error-badge {
    position: absolute;
    top: -9px;
    right: 12px;
    background: #1a0a0a;
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #f87171;
    font-size: 0.65rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.04em;
    padding: 1px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    pointer-events: none;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    40%       { transform: translateX(5px); }
    60%       { transform: translateX(-3px); }
    80%       { transform: translateX(3px); }
}

.has-error {
    animation: shake 0.4s ease;
}

/* Password input with toggle button */
.form-input.has-toggle {
    padding-right: 3rem;
}

.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.20);
    display: flex;
    align-items: center;
    padding: 0;
    transition: color 0.2s ease;
    font-size: 1.125rem;
}

.password-toggle-btn:hover {
    color: rgba(255, 255, 255, 0.60);
}

/* ==========================================
   Remember Me Checkbox
   ========================================== */
.remember-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-top: -0.25rem;
}

.remember-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.05);
    accent-color: var(--primary-color, #2d7b4f);
    cursor: pointer;
    flex-shrink: 0;
}

.remember-label {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.40);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.remember-label:hover {
    color: rgba(255, 255, 255, 0.60);
}

/* ==========================================
   Login Button
   ========================================== */
.login-btn {
    width: 100%;
    height: 3.5rem;
    background: linear-gradient(135deg, #2d7b4f 0%, #3da86e 100%);
    border: 1px solid rgba(74,222,128,0.2);
    border-radius: 0.75rem;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    transition: all 0.25s ease;
    margin-top: 0.5rem;
    box-shadow: 0 4px 20px rgba(45,122,79,0.3);
}

.login-btn:hover {
    background: linear-gradient(135deg, #368f5c 0%, #4ade80 100%);
    box-shadow: 0 6px 28px rgba(45,122,79,0.5);
    transform: translateY(-1px);
}

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

.login-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.login-btn .btn-icon {
    font-size: 1rem;
}

/* Spin animation for loading */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ==========================================
   Footer
   ========================================== */
.auth-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.auth-footer-copy {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.30);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 500;
    margin: 0;
}

.auth-footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.auth-footer-links a {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.30);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: color 0.2s ease;
}

.auth-footer-links a:hover {
    color: var(--primary-color, #2d7b4f);
}

/* ==========================================
   Autofill Override
   ========================================== */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #08120a inset !important;
    -webkit-text-fill-color: white !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ==========================================
   Responsive — Tablet & Mobile
   ========================================== */
@media (min-width: 1440px) {
    .auth-container {
        max-width: 1120px;
        min-height: 700px;
    }

    .left-panel,
    .right-panel {
        padding: 3.25rem;
    }

    .logo-wrapper img {
        height: 12rem;
    }
}

@media (min-width: 1920px) {
    .auth-container {
        max-width: 1240px;
        min-height: 740px;
    }

    .left-panel,
    .right-panel {
        padding: 3.5rem;
    }
}

@media (max-width: 1024px) {
    .auth-container {
        max-width: 900px;
        min-height: 620px;
    }

    .left-panel,
    .right-panel {
        padding: 2.25rem 1.75rem;
    }
}

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
        min-height: auto;
        border-radius: 1rem;
    }

    .left-panel {
        width: 100%;
        padding: 2rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .logo-wrapper {
        padding: 3rem 0;
    }

    .logo-wrapper img {
        height: 7rem;
    }

    .brand-info h2 {
        font-size: 1.25rem;
    }

    .right-panel {
        width: 100%;
        padding: 2rem 1.5rem;
    }

    .form-title {
        font-size: 1.75rem;
    }

    .auth-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .auth-footer-links {
        justify-content: center;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .login-body {
        padding: 0.75rem;
    }

    .left-panel,
    .right-panel {
        padding: 1.5rem 1rem;
    }

    .logo-wrapper img {
        height: 5.5rem;
    }

    .form-input {
        height: 3rem;
        font-size: 0.875rem;
    }

    .login-btn {
        height: 3rem;
        font-size: 0.75rem;
    }
}
