/* ==========================================================================
   Bitspark Global - Production Authentication UI & Components
   ========================================================================== */

/* Auth Section Wrapper */
.auth-page-section {
    padding: 80px 0 100px;
    background-color: var(--bg-color);
}

.auth-container-box {
    background: var(--white-color);
    border-radius: 16px;
    border: 1px solid var(--divider-color);
    box-shadow: 0 20px 40px rgba(22, 22, 22, 0.05);
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
}

/* Left Branding Column */
.auth-branding-col {
    flex: 1 1 40%;
    background: var(--primary-color);
    padding: 60px 40px;
    color: var(--white-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-branding-col::before {
    content: "";
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(239, 72, 35, 0.25) 0%, rgba(239, 72, 35, 0) 70%);
    pointer-events: none;
}

.auth-branding-header h3 {
    color: var(--white-color);
    font-size: 28px;
    margin-bottom: 12px;
}

.auth-branding-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
    line-height: 1.6em;
}

.auth-features-list {
    margin: 35px 0;
    padding: 0;
    list-style: none;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
}

.auth-feature-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(239, 72, 35, 0.15);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.auth-branding-footer {
    padding-top: 20px;
    border-top: 1px solid var(--dark-divider-color);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Right Form Column */
.auth-form-col {
    flex: 1 1 60%;
    padding: 60px 50px;
    background: var(--white-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form-header {
    margin-bottom: 30px;
}

.auth-form-header h2 {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.auth-form-header p {
    font-size: 15px;
    color: var(--text-color);
    margin-bottom: 0;
}

.auth-form-header a {
    color: var(--accent-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-form-header a:hover {
    text-decoration: underline;
}

/* Google OAuth Button */
.btn-google-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    background: var(--white-color);
    border: 1px solid var(--divider-color);
    border-radius: 8px;
    color: var(--primary-color);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-google-auth:hover {
    background: #F8F8F8;
    border-color: #D1CDC7;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.google-icon-svg {
    width: 20px;
    height: 20px;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 28px 0;
    color: #999999;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--divider-color);
}

.auth-divider span {
    padding: 0 15px;
}

/* Form Groups & Controls */
.auth-form-group {
    margin-bottom: 22px;
    position: relative;
}

.auth-form-group label:not(.custom-checkbox) {
    display: block;
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 8px;
}

.auth-form-group label.custom-checkbox {
    margin-bottom: 0;
    font-weight: 400;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 18px;
    color: #A3A3A3;
    font-size: 15px;
    pointer-events: none;
    transition: color 0.3s ease;
}

.auth-input-wrapper .form-control {
    height: 52px;
    padding-left: 48px;
    padding-right: 48px;
    border-radius: 8px;
    border: 1px solid var(--divider-color);
    font-size: 15px;
    color: var(--primary-color);
    background-color: #FAFAFA;
    transition: all 0.3s ease;
}

.auth-input-wrapper .form-control:focus {
    background-color: var(--white-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(239, 72, 35, 0.15);
    outline: none;
}

.auth-input-wrapper .form-control:focus + .auth-input-icon,
.auth-input-wrapper .form-control:focus ~ .auth-input-icon {
    color: var(--accent-color);
}

/* Password Toggle */
.password-toggle-btn {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: #888888;
    cursor: pointer;
    padding: 6px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.password-toggle-btn:hover {
    color: var(--primary-color);
}

/* Remember Me & Links */
.auth-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.custom-checkbox {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.4em;
    user-select: none;
    margin: 0;
}

.custom-checkbox input[type="checkbox"] {
    accent-color: var(--accent-color);
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    vertical-align: middle;
}

.custom-checkbox span {
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.45;
    display: inline-block;
}

.auth-forgot-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.auth-forgot-link:hover {
    text-decoration: underline;
    color: #d63c1a;
}

/* Submit Button & Loading State */
.auth-submit-btn {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    background: var(--accent-color);
    color: var(--white-color);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 10px;
}

.auth-submit-btn:hover {
    background: #d63c1a;
    box-shadow: 0 8px 20px rgba(239, 72, 35, 0.25);
    color: var(--white-color);
}

.auth-submit-btn:disabled,
.auth-submit-btn.btn-loading {
    opacity: 0.75;
    cursor: not-allowed;
    pointer-events: none;
}

.auth-btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    border-top-color: #FFFFFF;
    animation: spin 0.8s linear infinite;
}

.auth-submit-btn.btn-loading .auth-btn-spinner {
    display: inline-block;
}

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

/* Password Strength Meter */
.password-meter-box {
    margin-top: 10px;
}

.password-meter-bars {
    display: flex;
    gap: 6px;
    height: 5px;
    margin-bottom: 8px;
}

.meter-bar {
    flex: 1;
    height: 100%;
    background: #E5E5E5;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.password-meter-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-color);
}

.strength-label {
    font-weight: 600;
}

.strength-label.weak { color: #EF4444; }
.strength-label.medium { color: #F59E0B; }
.strength-label.strong { color: #10B981; }
.strength-label.very-strong { color: #059669; }

.password-requirements {
    margin-top: 8px;
    padding: 0;
    list-style: none;
    font-size: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.req-item {
    color: #888888;
    display: flex;
    align-items: center;
    gap: 6px;
}

.req-item.valid {
    color: #10B981;
}

.req-item.valid i {
    color: #10B981;
}

/* 6-Digit OTP Segmented Input */
.otp-container {
    text-align: center;
    margin: 30px 0 25px;
}

.otp-digit-grid {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.otp-digit-box {
    width: 52px;
    height: 60px;
    border: 2px solid var(--divider-color);
    border-radius: 10px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    background: #FAFAFA;
    transition: all 0.3s ease;
}

.otp-digit-box:focus {
    border-color: var(--accent-color);
    background: var(--white-color);
    box-shadow: 0 0 0 3px rgba(239, 72, 35, 0.15);
    outline: none;
}

.otp-timer-box {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 15px;
}

.otp-countdown-val {
    font-weight: 600;
    color: var(--primary-color);
}

.resend-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: opacity 0.3s ease;
}

.resend-btn:disabled {
    color: #999999;
    cursor: not-allowed;
    text-decoration: none;
}

/* Alerts and Banners */
.auth-alert {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.4em;
}

.auth-alert-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.auth-alert-danger {
    background-color: #FEF2F2;
    border: 1px solid #F87171;
    color: #991B1B;
}

.auth-alert-warning {
    background-color: #FFFBEB;
    border: 1px solid #FCD34D;
    color: #92400E;
}

.auth-alert-success {
    background-color: #ECFDF5;
    border: 1px solid #34D399;
    color: #065F46;
}

.auth-alert-info {
    background-color: #EFF6FF;
    border: 1px solid #60A5FA;
    color: #1E40AF;
}

/* Dashboard UI */
.dashboard-wrapper {
    padding: 60px 0 100px;
    background-color: var(--bg-color);
}

.dashboard-card {
    background: var(--white-color);
    border-radius: 14px;
    border: 1px solid var(--divider-color);
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(22, 22, 22, 0.04);
}

.dashboard-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--divider-color);
    margin-bottom: 30px;
}

.profile-user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-avatar-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--white-color);
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--accent-color);
    overflow: hidden;
}

.profile-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-title-box h2 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.profile-title-box p {
    font-size: 14px;
    color: var(--text-color);
    margin: 0;
}

.role-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.role-badge-admin {
    background-color: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.role-badge-employee {
    background-color: #EFF6FF;
    color: #2563EB;
    border: 1px solid #BFDBFE;
}

.role-badge-customer {
    background-color: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box-item {
    background: #F9F9F8;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--divider-color);
}

.stat-box-item .stat-title {
    font-size: 13px;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-box-item .stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.dashboard-actions-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Responsive Media Queries */
@media (max-width: 991px) {
    .auth-container-box {
        flex-direction: column;
    }
    .auth-branding-col {
        padding: 40px 30px;
    }
    .auth-form-col {
        padding: 40px 30px;
    }
}

@media (max-width: 575px) {
    .auth-page-section {
        padding: 40px 0 60px;
    }
    .auth-form-col {
        padding: 30px 20px;
    }
    .otp-digit-box {
        width: 42px;
        height: 52px;
        font-size: 20px;
    }
    .otp-digit-grid {
        gap: 8px;
    }
    .password-requirements {
        grid-template-columns: 1fr;
    }
}
