/* iw-login.css - Enhanced Version */
@import url('https://fonts.googleapis.com/css2?family=Philosopher:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&display=swap');

:root {
    --iw-primary: #234e52;
    --iw-secondary: #7f1102;
    --iw-third: #d4a373;
    --iw-fourth: #a3be8c;
    --iw-light: #f8f5f0;
    --iw-error: #e53e3e;
    --iw-success: #38a169;
    --iw-border-radius: 12px;
    --iw-transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Philosopher', sans-serif;
    background: linear-gradient(135deg, var(--iw-primary) 0%, var(--iw-secondary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

.iw-login-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px 0;
}

.iw-login-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.iw-bg-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0.5;
}

.iw-floating-islamic-icon {
    position: absolute;
    color: rgba(255, 255, 255, 0.15);
    z-index: 2;
    animation: iw-float 15s infinite linear;
    font-size: 40px;
}

.iw-icon-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 20s;
}

.iw-icon-2 {
    top: 70%;
    right: 15%;
    animation-delay: 5s;
    animation-duration: 25s;
}

.iw-icon-3 {
    bottom: 20%;
    left: 20%;
    animation-delay: 10s;
    animation-duration: 18s;
}

.iw-icon-4 {
    top: 30%;
    right: 25%;
    animation-delay: 7s;
    animation-duration: 22s;
}

.iw-login-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.iw-login-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--iw-border-radius);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    padding: 40px;
    width: 100%;
    backdrop-filter: blur(10px);
    animation: iw-fadeIn 0.8s ease-out;
    position: relative;
    overflow: visible;
}

.iw-login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--iw-primary), var(--iw-secondary), var(--iw-third), var(--iw-fourth));
    border-radius: var(--iw-border-radius) var(--iw-border-radius) 0 0;
}

.iw-logo-container {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.iw-logo-bg {
    display: inline-block;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: var(--iw-transition);
}

.iw-logo-bg:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.iw-logo {
    height: 60px;
    width: auto;
}

.iw-welcome-message {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.iw-arabic-greeting {
    font-family: 'Amiri', serif;
    font-size: 28px;
    color: var(--iw-primary);
    margin-bottom: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.iw-welcome-text {
    color: var(--iw-secondary);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.iw-login-form {
    margin-bottom: 20px;
}

.iw-form-group {
    margin-bottom: 20px;
    position: relative;
}

.iw-form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--iw-primary);
    font-weight: 700;
    font-size: 14px;
}

.iw-input-with-icon {
    position: relative;
}

.iw-form-input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid var(--iw-third);
    border-radius: 10px;
    font-size: 16px;
    transition: var(--iw-transition);
    font-family: 'Philosopher', sans-serif;
    background: rgba(255, 255, 255, 0.9);
}

.iw-form-input:focus {
    outline: none;
    border-color: var(--iw-primary);
    box-shadow: 0 0 0 3px rgba(35, 78, 82, 0.2);
    background: white;
}

.iw-input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--iw-third);
    font-size: 18px;
    z-index: 2;
}

.iw-password-container {
    position: relative;
}

.iw-password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--iw-third);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--iw-transition);
    z-index: 2;
}

.iw-password-toggle:hover {
    background-color: rgba(35, 78, 82, 0.1);
}

.iw-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.iw-remember-me, .iw-forgot-password {
    margin-bottom: 0;
    flex: 1;
}

.iw-forgot-password {
    text-align: right;
}

.iw-forgot-password a {
    color: var(--iw-secondary);
    text-decoration: none;
    font-weight: 700;
    transition: var(--iw-transition);
}

.iw-forgot-password a:hover {
    color: var(--iw-primary);
    text-decoration: underline;
}

.iw-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    color: var(--iw-primary);
    position: relative;
    transition: var(--iw-transition);
}

.iw-checkbox-label:hover {
    color: var(--iw-secondary);
}

.iw-checkbox-label input {
    display: none;
}

.iw-checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid var(--iw-third);
    border-radius: 5px;
    margin-right: 8px;
    position: relative;
    transition: var(--iw-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.iw-checkbox-label input:checked + .iw-checkbox-custom {
    border-color: var(--iw-primary);
    background-color: var(--iw-primary);
}

.iw-checkbox-label input:checked + .iw-checkbox-custom::after {
    content: '✓';
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.iw-form-button {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--iw-primary) 0%, var(--iw-secondary) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--iw-transition);
    font-family: 'Philosopher', sans-serif;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.iw-form-button::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: all 0.6s ease;
}

.iw-form-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.iw-form-button:hover::before {
    left: 100%;
}

.iw-form-button:active {
    transform: translateY(0);
}

.iw-button-icon {
    font-size: 20px;
}

.iw-button-loader {
    display: none;
    position: absolute;
    right: 15px;
}

.iw-loader-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: iw-spin 0.8s linear infinite;
}

.iw-login-footer {
    text-align: center;
    color: var(--iw-primary);
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(212, 163, 115, 0.3);
}

.iw-login-footer a {
    color: var(--iw-secondary);
    font-weight: 700;
    text-decoration: none;
    transition: var(--iw-transition);
}

.iw-login-footer a:hover {
    color: var(--iw-primary);
    text-decoration: underline;
}

/* Error Styles */
.iw-form-error {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 700;
    text-align: left;
    animation: iw-fadeIn 0.5s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(229, 62, 62, 0.1);
    border-left: 4px solid var(--iw-error);
    color: var(--iw-error);
}

.iw-field-error {
    color: var(--iw-error);
    font-size: 14px;
    margin-top: 5px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.iw-field-error::before {
    content: '!';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background-color: var(--iw-error);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

/* Modal Styles */
.iw-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.iw-modal-active {
    opacity: 1;
    visibility: visible;
}

.iw-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.iw-modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    position: relative;
    z-index: 1001;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: all 0.3s ease;
    text-align: center;
}

.iw-modal-active .iw-modal-content {
    transform: translateY(0);
}

.iw-modal-header {
    margin-bottom: 20px;
}

.iw-modal-icon {
    margin-bottom: 15px;
    font-size: 48px;
    color: var(--iw-primary);
}

.iw-modal-title {
    color: var(--iw-primary);
    font-size: 24px;
    margin-bottom: 10px;
    font-family: 'Amiri', serif;
}

.iw-modal-body {
    margin-bottom: 25px;
}

.iw-modal-body p {
    color: var(--iw-secondary);
    font-size: 16px;
    line-height: 1.5;
}

.iw-modal-footer {
    display: flex;
    justify-content: center;
}

.iw-modal-loader {
    width: 40px;
    height: 40px;
    position: relative;
}

.iw-modal-loader-circle {
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid var(--iw-primary);
    border-radius: 50%;
    animation: iw-spin 1s linear infinite;
}

/* Animations */
@keyframes iw-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes iw-float {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
    100% {
        transform: translateY(0) rotate(360deg);
    }
}

@keyframes iw-spin {
    0% {
        transform: rotate(0deg);
    }
   100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .iw-login-card {
        padding: 30px 20px;
    }
    
    .iw-form-row {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .iw-forgot-password {
        text-align: left;
    }
    
    .iw-arabic-greeting {
        font-size: 24px;
    }
    
    .iw-welcome-text {
        font-size: 15px;
    }
    
    .iw-logo {
        height: 50px;
    }
}

@media (max-width: 480px) {
    .iw-login-card {
        padding: 25px 15px;
    }
    
    .iw-logo {
        height: 40px;
    }
    
    .iw-arabic-greeting {
        font-size: 22px;
    }
    
    .iw-form-button {
        padding: 15px;
        font-size: 16px;
    }
    
    body {
        padding: 10px;
    }
}

/* Arabic font support */
.arabic {
    font-family: 'Amiri', serif;
    direction: rtl;
}

/* Loading state */
.iw-loading .iw-button-text {
    visibility: hidden;
}

.iw-loading .iw-button-loader {
    display: block;
}

/* Input error state */
.iw-input-error {
    border-color: var(--iw-error) !important;
}

/* Success state */
.iw-input-success {
    border-color: var(--iw-success) !important;
}