/* ==========================================
   1. BRAND VARIABLES
   ========================================== */
:root {
    --acb-orange: #FF6600;
    --acb-dark-blue: #364352;
    --acb-gray: #666E77;
    --input-border: #D1D5DB;
    --white: #FFF;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: #f3f6f8;
    overflow-x: hidden;
}

/* ==========================================
   2. THE LOGIN SCREEN (Backdrop & Alignment)
   ========================================== */
html:has(.login-screen),
html:has(.login-screen) body {
    height: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.login-screen {
    background: url('/img/ACBInsightNew.png') no-repeat center center;
    background-size: cover;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.login-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 100%);
    z-index: 0;
}

@media (min-width: 769px) {
    .login-screen {
        justify-content: flex-end;
        padding-right: 12%;
    }
}

/* ==========================================
   3. THE LOGIN FORM (Glass Card)
   ========================================== */
.login-form {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
    padding: 2.5rem 2rem 2rem;
    width: 22rem;
    max-width: 90vw;
    text-align: center;
    animation: formEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes formEntrance {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Legacy logo (CSS-based) */
.app-logo-css::before {
    content: "";
    display: block;
    width: 100%;
    height: 4.25rem;
    background: url('/img/ACBLogo.png') center / contain no-repeat;
    margin-bottom: 1.25rem;
}

/* Dynamic tenant logo */
.login-logo {
    display: block;
    max-width: 85%;
    height: 5rem;
    object-fit: contain;
    margin: 0 auto 1.75rem;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.06));
}

/* ==========================================
   4. INPUTS
   ========================================== */
.os-form-control-label {
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.375rem;
    display: block;
}

.input-icon-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.input-icon-wrapper > i:first-child {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.8125rem;
    z-index: 2;
    transition: color 0.2s ease;
}

.input-icon-wrapper:focus-within > i:first-child {
    color: var(--accent-primary, var(--acb-orange));
}

.form-control {
    width: 100%;
    padding: 0.75rem 0.875rem 0.75rem 2.5rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    font-family: inherit;
    color: #1e293b;
    background: rgba(248, 250, 252, 0.8);
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-control:hover {
    border-color: #cbd5e1;
    background: rgba(255, 255, 255, 0.9);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary, var(--acb-orange));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary, var(--acb-orange)) 12%, transparent);
    background: #fff;
}

/* Hides browser auto-fill icons */
.form-control::-webkit-contacts-auto-fill-button,
.form-control::-webkit-credentials-auto-fill-button {
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    right: 0;
}

/* ==========================================
   5. BUTTON
   ========================================== */
.btn-primary {
    width: 100%;
    padding: 0.8125rem;
    background: var(--accent-gradient, linear-gradient(135deg, #FF6600 0%, #FF9F0D 100%));
    color: var(--white);
    border: none;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.8125rem;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
    border-radius: inherit;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary .btn-loader {
    display: none;
}

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

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

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

/* ==========================================
   6. PASSWORD TOGGLE
   ========================================== */
.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.375rem;
    font-size: 0.8125rem;
    transition: color 0.2s ease;
    border-radius: 0.375rem;
}

.password-toggle:hover {
    color: var(--accent-primary, var(--acb-orange));
}

/* ==========================================
   7. FORM OPTIONS (Remember Me & Forgot)
   ========================================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    font-size: 0.75rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    cursor: pointer;
    user-select: none;
    font-weight: 500;
}

.remember-me input[type="checkbox"] {
    display: none;
}

.remember-me .checkmark {
    width: 1.0625rem;
    height: 1.0625rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 0.3125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remember-me:hover .checkmark {
    border-color: var(--accent-primary, var(--acb-orange));
}

.remember-me input:checked + .checkmark {
    background: var(--accent-primary, var(--acb-orange));
    border-color: var(--accent-primary, var(--acb-orange));
}

.remember-me input:checked + .checkmark::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.5625rem;
    color: white;
}

.forgot-password {
    color: var(--accent-primary, var(--acb-orange));
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

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

/* ==========================================
   8. DEMO SECTION
   ========================================== */
.demo-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.demo-trigger {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #94a3b8;
    font-size: 0.6875rem;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.5px;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.demo-trigger:hover {
    background: #f1f5f9;
    color: #64748b;
    border-color: #cbd5e1;
}

.demo-code-input {
    margin-top: 0.75rem;
}

.demo-code-row {
    display: flex;
    gap: 0.5rem;
}

.demo-code-field {
    flex: 1;
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #1e293b;
    font-size: 0.75rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.demo-code-field:focus {
    border-color: var(--accent-primary, var(--acb-orange));
}

.demo-verify-btn {
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    border: none;
    background: #6366f1;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.demo-verify-btn:hover {
    background: #4f46e5;
}

.demo-error {
    margin-top: 0.5rem;
    font-size: 0.6875rem;
    color: #ef4444;
}

.demo-label {
    font-size: 0.6875rem;
    color: #94a3b8;
    margin-bottom: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.demo-buttons-row {
    display: flex;
    gap: 0.625rem;
}

.demo-btn {
    flex: 1;
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.demo-btn--customer {
    border: 1px solid rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.06);
    color: #d97706;
}

.demo-btn--customer:hover {
    background: rgba(245, 158, 11, 0.12);
}

.demo-btn--employee {
    border: 1px solid rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.06);
    color: #2563eb;
}

.demo-btn--employee:hover {
    background: rgba(59, 130, 246, 0.12);
}
