/* IBM Plex Sans Arabic Font */
@font-face {
    font-family: 'IBMPlexSansArabic';
    src: url('fonts/IBMPlexSansArabic-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'IBMPlexSansArabic';
    src: url('fonts/IBMPlexSansArabic-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'IBMPlexSansArabic';
    src: url('fonts/IBMPlexSansArabic-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    font-family: 'IBMPlexSansArabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /* Updated background: FFFAFF 80% + AD1F24 20% */
    background: linear-gradient(135deg, #FFFAFF 100%, #AD1F24 0%);
    color: #1E1B18; /* Updated font color */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Main Login Container with Responsive Sizing */
.login-container {
    width: 90%;
    max-width: 480px;
    min-width: 320px;
    padding: 40px;
   
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 20px 50px rgba(30, 27, 24, 0.15),
        0 10px 30px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 2;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Responsive Container Sizing */
@media (min-width: 1600px) {
    .login-container {
        max-width: 520px;
        padding: 50px;
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 35px 30px;
        max-width: 420px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 30px 25px;
        width: 95%;
        min-width: 300px;
        margin: 20px;
    }
}

@media (max-width: 360px) {
    .login-container {
        padding: 25px 20px;
        min-width: 280px;
    }
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(173, 31, 36, 0.2), transparent);
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.logo-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

@media (max-width: 768px) {
    .logo-wrapper {
        width: 100px;
        height: 100px;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .logo-wrapper {
        width: 90px;
        height: 90px;
        margin-bottom: 12px;
    }
}

.logo-glass {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    border: 1px solid rgba(173, 31, 36, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 15px 35px rgba(30, 27, 24, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.logo-icon {
    width: 60px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .logo-icon {
        width: 50px;
    }
}

@media (max-width: 480px) {
    .logo-icon {
        width: 45px;
    }
}

.app-name {
    margin-top: 20px;
}

.brand-name {
    font-size: 32px;
    font-weight: 600;
    color: #1E1B18; /* Updated font color */
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .brand-name {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .brand-name {
        font-size: 24px;
    }
}

.brand-subtitle {
    font-size: 14px;
    font-weight: 300;
    color: #1E1B18; /* Updated font color */
    opacity: 0.7;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

@media (max-width: 480px) {
    .brand-subtitle {
        font-size: 12px;
        letter-spacing: 1px;
    }
}

/* Form Wrapper */
.form-wrapper {
    position: relative;
    width: 100%;
}

.form-header {
    text-align: center;
    margin-bottom: 35px;
}

@media (max-width: 768px) {
    .form-header {
        margin-bottom: 30px;
    }
}

@media (max-width: 480px) {
    .form-header {
        margin-bottom: 25px;
    }
}

.form-header h2 {
    font-size: 26px;
    font-weight: 600;
    color: #1E1B18; /* Updated font color */
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.form-header h2 i {
    color: #AD1F24; /* Icon color for header */
    font-size: 24px;
}

@media (max-width: 768px) {
    .form-header h2 {
        font-size: 22px;
    }
    
    .form-header h2 i {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .form-header h2 {
        font-size: 20px;
        gap: 8px;
    }
    
    .form-header h2 i {
        font-size: 18px;
    }
}

.form-header p {
    color: #1E1B18; /* Updated font color */
    opacity: 0.7;
    font-size: 15px;
    font-weight: 300;
}

@media (max-width: 480px) {
    .form-header p {
        font-size: 14px;
    }
}

/* Error Message */
.glass-error {
    background: rgba(173, 31, 36, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(173, 31, 36, 0.2);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #AD1F24;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

@media (max-width: 480px) {
    .glass-error {
        padding: 14px;
        margin-bottom: 20px;
        font-size: 13px;
    }
}

.glass-error::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #AD1F24, transparent);
}

.glass-error i.fa-exclamation-triangle {
    font-size: 18px;
    flex-shrink: 0;
    color: #AD1F24; /* Icon color */
}

@media (max-width: 480px) {
    .glass-error i.fa-exclamation-triangle {
        font-size: 16px;
    }
}

.glass-error .close-error {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
    flex-shrink: 0;
    color: #1E1B18; /* Updated font color */
}

.glass-error .close-error:hover {
    opacity: 1;
}

/* Input Groups */
.input-group {
    margin-bottom: 30px;
    width: 100%;
}

@media (max-width: 768px) {
    .input-group {
        margin-bottom: 25px;
    }
}

@media (max-width: 480px) {
    .input-group {
        margin-bottom: 20px;
    }
}

.input-with-icon {
    position: relative;
    width: 100%;
}

.floating-label {
    position: relative;
    width: 100%;
}

.floating-label label {
    position: absolute;
    top: 50%;
    left: 48px;
    transform: translateY(-50%);
    color: #1E1B18; /* Updated font color */
    opacity: 0.6;
    font-size: 15px;
    font-weight: 300;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 96px);
}

@media (max-width: 480px) {
    .floating-label label {
        left: 45px;
        font-size: 14px;
        max-width: calc(100% - 90px);
    }
}

.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
    top: 5px;
    transform: translateY(0);
    font-size: 12px;
    color: #AD1F24;
}

.input-with-icon i:first-child {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #AD1F24; /* Icon color */
    font-size: 18px;
    z-index: 2;
}

@media (max-width: 480px) {
    .input-with-icon i:first-child {
        left: 16px;
        font-size: 16px;
    }
}

.toggle-password {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #1E1B18; /* Updated font color */
    opacity: 0.5;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 2;
}

@media (max-width: 480px) {
    .toggle-password {
        right: 16px;
        font-size: 15px;
    }
}

.toggle-password:hover {
    color: #AD1F24;
    opacity: 1;
}

.glass-input {
    width: 100%;
    padding: 18px 18px 18px 52px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(173, 31, 36, 0.1);
    border-radius: 16px;
    font-family: 'IBMPlexSansArabic', sans-serif;
    font-size: 15px;
    color: #1E1B18; /* Updated font color */
    transition: all 0.3s ease;
    outline: none;
    position: relative;
    z-index: 1;
    box-shadow: 
        0 4px 12px rgba(30, 27, 24, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

@media (max-width: 768px) {
    .glass-input {
        padding: 16px 16px 16px 50px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .glass-input {
        padding: 15px 15px 15px 48px;
        font-size: 14px;
        border-radius: 14px;
    }
}

.glass-input::placeholder {
    color: transparent;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(173, 31, 36, 0.3);
    box-shadow: 
        0 8px 20px rgba(173, 31, 36, 0.1),
        0 0 0 2px rgba(173, 31, 36, 0.05);
}

.input-hint {
    font-size: 12px;
    color: #1E1B18; /* Updated font color */
    opacity: 0.5;
    margin-top: 8px;
    margin-left: 20px;
    transition: color 0.3s;
}

@media (max-width: 480px) {
    .input-hint {
        font-size: 11px;
        margin-left: 16px;
        margin-top: 6px;
    }
}

.glass-input:focus ~ .input-hint {
    color: #AD1F24;
    opacity: 0.8;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    width: 100%;
    flex-wrap: wrap;
    gap: 15px;
}

@media (max-width: 768px) {
    .form-options {
        margin-bottom: 25px;
    }
}

@media (max-width: 480px) {
    .form-options {
        margin-bottom: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #1E1B18; /* Updated font color */
    opacity: 0.8;
    font-size: 14px;
    user-select: none;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .checkbox-container {
        font-size: 13px;
    }
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(173, 31, 36, 0.2);
    border-radius: 5px;
    margin-right: 10px;
    position: relative;
    transition: all 0.3s;
    flex-shrink: 0;
}

.checkbox-container input:checked ~ .checkmark {
    background: #AD1F24;
    border-color: #AD1F24;
}

.checkmark::after {
    content: '';
    position: absolute;
    display: none;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark::after {
    display: block;
}

.forgot-password {
    color: #1E1B18; /* Updated font color */
    opacity: 0.7;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    white-space: nowrap;
}

@media (max-width: 480px) {
    .forgot-password {
        font-size: 13px;
        padding: 6px 10px;
        align-self: flex-start;
    }
}

.forgot-password i {
    color: #AD1F24; /* Icon color */
    font-size: 13px;
}

.forgot-password:hover {
    color: #1E1B18;
    opacity: 1;
    background: rgba(255, 255, 255, 0.9);
}

/* Glass Button */
.glass-button {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, #AD1F24 0%, #C82333 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-family: 'IBMPlexSansArabic', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 15px 35px rgba(173, 31, 36, 0.2),
        0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    .glass-button {
        padding: 16px 20px;
        font-size: 15px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .glass-button {
        padding: 15px 18px;
        font-size: 15px;
        border-radius: 14px;
        margin-bottom: 18px;
    }
}

.glass-button:hover {
    background: linear-gradient(135deg, #C82333 0%, #AD1F24 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 20px 40px rgba(173, 31, 36, 0.3),
        0 8px 20px rgba(0, 0, 0, 0.15);
}

.glass-button:active {
    transform: translateY(0);
}

.button-content {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.glass-button i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

@media (max-width: 480px) {
    .glass-button i {
        font-size: 15px;
    }
    
    .button-content {
        gap: 10px;
    }
}

.glass-button:hover i {
    transform: translateX(3px);
}

/* Button Loader */
.button-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #AD1F24 0%, #C82333 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 3;
}

.loader-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@media (max-width: 480px) {
    .loader-spinner {
        width: 20px;
        height: 20px;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.glass-button.loading .button-content {
    opacity: 0;
}

.glass-button.loading .button-loader {
    opacity: 1;
    visibility: visible;
}

/* Quick Links */
.quick-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
    width: 100%;
}

@media (max-width: 768px) {
    .quick-links {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .quick-links {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }
}

.quick-link {
    color: #1E1B18; /* Updated font color */
    opacity: 0.6;
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    white-space: nowrap;
}

@media (max-width: 480px) {
    .quick-link {
        font-size: 12px;
        padding: 5px 10px;
        width: 100%;
        justify-content: center;
    }
}

.quick-link i {
    color: #AD1F24; /* Icon color */
    font-size: 12px;
}

.quick-link:hover {
    color: #1E1B18;
    opacity: 1;
    background: rgba(255, 255, 255, 0.9);
}

.divider {
    color: #1E1B18; /* Updated font color */
    opacity: 0.3;
    font-size: 10px;
}

@media (max-width: 480px) {
    .divider {
        display: none;
    }
}

/* Footer */
.footer {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid rgba(30, 27, 24, 0.1);
    text-align: center;
    width: 100%;
}

@media (max-width: 768px) {
    .footer {
        margin-top: 30px;
        padding-top: 20px;
    }
}

@media (max-width: 480px) {
    .footer {
        margin-top: 25px;
        padding-top: 20px;
    }
}

.security-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #1E1B18; /* Updated font color */
    opacity: 0.6;
    font-size: 12px;
    margin-bottom: 15px;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .security-info {
        font-size: 11px;
        padding: 8px 14px;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .security-info {
        font-size: 10px;
        padding: 6px 12px;
        margin-bottom: 12px;
    }
}

.security-info i {
    color: #AD1F24; /* Icon color */
    font-size: 12px;
}

@media (max-width: 480px) {
    .security-info i {
        font-size: 11px;
    }
}

.developer-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #1E1B18; /* Updated font color */
    opacity: 0.7;
    font-size: 13px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .developer-info {
        gap: 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .developer-info {
        flex-direction: column;
        gap: 8px;
        font-size: 11px;
    }
}

.copyright {
    font-weight: 300;
}

.separator {
    width: 1px;
    height: 14px;
    background: rgba(30, 27, 24, 0.3);
}

@media (max-width: 480px) {
    .separator {
        width: 40px;
        height: 1px;
    }
}

.developer {
    display: flex;
    align-items: center;
    gap: 6px;
}

.developer i {
    color: #AD1F24; /* Icon color */
    font-size: 10px;
}

/* Landscape Orientation Support */
@media (max-height: 600px) and (orientation: landscape) {
    .login-container {
        max-height: 90vh;
        overflow-y: auto;
        padding: 25px 30px;
    }
    
    .logo-section {
        margin-bottom: 20px;
    }
    
    .logo-wrapper {
        width: 80px;
        height: 80px;
        margin-bottom: 10px;
    }
    
    .logo-icon {
        width: 40px;
    }
    
    .brand-name {
        font-size: 22px;
        margin-bottom: 4px;
    }
    
    .brand-subtitle {
        font-size: 11px;
        letter-spacing: 1px;
    }
    
    .form-header {
        margin-bottom: 20px;
    }
    
    .form-header h2 {
        font-size: 18px;
        margin-bottom: 4px;
    }
    
    .form-header p {
        font-size: 13px;
    }
    
    .input-group {
        margin-bottom: 15px;
    }
    
    .form-options {
        margin-bottom: 15px;
    }
    
    .glass-button {
        padding: 12px 18px;
        margin-bottom: 15px;
    }
    
    .footer {
        margin-top: 20px;
        padding-top: 15px;
    }
}