/* ====================================================================
   Modern Identity Theme - Glassmorphic Design
   Created: 2026-01-31
   Purpose: Shared styles for all Identity area pages
   ==================================================================== */

/* CSS Variables - Color Palette & Design Tokens
   ================================================================== */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --input-bg: rgba(0, 0, 0, 0.3);
    --input-border: rgba(255, 255, 255, 0.15);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 30px 80px rgba(0, 0, 0, 0.4);
}

/* Dark Background & Header - Match Landing Pages
   ================================================================== */

body {
    background: #1a1a2e !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.2) 100%);
    z-index: -1;
    pointer-events: none;
}

.page-header {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.2) 100%) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Layout Components
   ================================================================== */

.modern-login-wrapper {
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    z-index: 10;
}

.modern-login-card {
    position: relative;
    padding: 0;
    border-radius: 24px;
    overflow: visible;
}

/* Glassmorphic Card - Main Content Container
   ================================================================== */

.login-card-inner {
    position: relative;
    background: linear-gradient(135deg, #080e16b0 0%, #0b1421c7 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-card-inner:hover {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    transform: translateY(-4px);
}

/* Typography - Headers & Text
   ================================================================== */

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-title {
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin: 0;
}

/* Form Elements - Inputs & Labels
   ================================================================== */

.modern-form-group {
    margin-bottom: 30px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #ffffff;
    font-size: 1rem;
    transition: all 0.3s ease;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.modern-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text-primary) !important;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

/* Prevent browser autocomplete from changing background */
.modern-input:-webkit-autofill,
.modern-input:-webkit-autofill:hover,
.modern-input:-webkit-autofill:focus,
.modern-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 100px rgba(0, 0, 0, 0.3) inset !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 0 0 100px rgba(0, 0, 0, 0.3) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.modern-input:focus {
    background: rgba(0, 0, 0, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
}

/* Ensure valid state keeps dark background */
.modern-input:valid {
    background: var(--input-bg) !important;
}

.modern-input:focus~.input-icon {
    color: var(--text-primary);
    transform: translateY(-50%) scale(1.1);
}

/* Floating Label Animation
   ================================================================== */

.floating-label {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    padding: 0 4px;
}

.modern-input:focus~.floating-label,
.modern-input:not(:placeholder-shown)~.floating-label,
.modern-input:valid~.floating-label {
    top: -12px;
    left: 6px;
    font-size: 0.75rem;
    color: var(--text-primary);
}

/* Animated Input Border
   ================================================================== */

.input-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.modern-input:focus~.input-border {
    width: 100%;
}

/* Validation Feedback
   ================================================================== */

.invalid-feedback {
    font-size: 0.85rem;
    margin-top: 6px;
    font-family: 'Inter', sans-serif;
}

/* Custom Checkbox - Modern Design
   ================================================================== */

.modern-checkbox-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 12px;
}

.modern-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.modern-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: relative;
    height: 20px;
    width: 20px;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.modern-checkbox:hover .checkmark {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.modern-checkbox input:checked~.checkmark {
    background: var(--primary-gradient);
    border-color: transparent;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.modern-checkbox input:checked~.checkmark:after {
    display: block;
}

.checkbox-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

/* Links - Animated Underline
   ================================================================== */

.forgot-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    position: relative;
}

.forgot-link:after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background: var(--text-primary);
    transition: width 0.3s ease;
}

.forgot-link:hover {
    color: var(--text-primary);
}

.forgot-link:hover:after {
    width: 100%;
}

/* Buttons - Gradient with Animations
   ================================================================== */

.modern-btn {
    width: 100%;
    padding: 12px 20px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.modern-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.modern-btn:hover:before {
    left: 100%;
}

.modern-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
}

.modern-btn:active {
    transform: translateY(0);
}

.btn-text,
.btn-icon {
    color: white !important;
    transition: all 0.3s ease;
}

.modern-btn:hover .btn-text,
.modern-btn:hover .btn-icon {
    color: white !important;
    transform: translateX(4px);
}

/* Alternative Login Section
   ================================================================== */

.alternative-login {
    margin-top: 32px;
}

.divider {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.divider:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--input-border);
}

.divider span {
    background: rgba(102, 126, 234, 0.2);
    padding: 4px 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    position: relative;
    z-index: 1;
    font-family: 'Inter', sans-serif;
    border-radius: 20px;
}

.pin-login-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.pin-login-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.pin-login-link i {
    font-size: 1.1rem;
}

/* Modern Error Alert - Replaces old Bootstrap alert-danger
   ================================================================== */

.modern-error-alert {
    background: linear-gradient(135deg, rgba(220, 75, 75, 0.15) 0%, rgba(200, 50, 50, 0.1) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(220, 75, 75, 0.3);
    border-left: 4px solid rgba(220, 75, 75, 0.8);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInDown 0.4s ease-out;
}

.modern-error-alert .error-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(220, 75, 75, 0.2);
    border-radius: 50%;
    color: #ff6b6b;
    font-size: 14px;
}

.modern-error-alert .error-content {
    flex: 1;
}

.modern-error-alert .error-content ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.modern-error-alert .error-content li {
    position: relative;
    margin-bottom: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.modern-error-alert .error-content li:before {
    content: '•';
    position: absolute;
    left: -12px;
    color: #ff6b6b;
}

.modern-error-alert .error-content li:last-child {
    margin-bottom: 0;
}

.modern-error-alert .close-btn {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.modern-error-alert .close-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Animations - Keyframes
   ================================================================== */

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Responsive - Mobile Optimizations
   ================================================================== */

@media (max-width: 768px) {
    .login-card-inner {
        padding: 36px 28px;
    }

    .login-title {
        font-size: 1.65rem;
    }

    .login-subtitle {
        font-size: 0.9rem;
    }

    .modern-checkbox-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .forgot-link {
        margin-left: 0;
    }
}

/* Mobile Request Specific - Larger Touch Targets
   ================================================================== */
.mobile-optimized .modern-input,
.mobile-optimized .modern-btn,
.mobile-optimized .checkbox-label,
.mobile-optimized .forgot-link,
.mobile-optimized .pin-login-link {
    font-size: 1.1rem;
}

.mobile-optimized .login-title {
    font-size: 1.85rem;
}

.mobile-optimized .modern-input {
    padding: 18px 18px 18px 52px;
}

.mobile-optimized .modern-btn {
    padding: 18px 24px;
}