/* ==========================================================================
   Auth Login Page Styles
   ========================================================================== */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family:
        "Cairo",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #0f172a;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Auth Container
   ========================================================================== */

.auth-container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

/* ==========================================================================
   Auth Card
   ========================================================================== */

.auth-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 48px 40px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo */
.auth-card__logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease-out 0.2s backwards;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Header */
.auth-card__header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-card__title {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.auth-card__subtitle {
    font-size: 15px;
    color: #64748b;
    font-weight: 400;
}

/* Footer */
.auth-card__footer {
    margin-top: 32px;
    text-align: center;
}

.footer-text {
    font-size: 13px;
    color: #94a3b8;
}

/* ==========================================================================
   Alerts
   ========================================================================== */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert__icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert__content {
    flex: 1;
}

.alert--error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert--error .alert__icon {
    color: #dc2626;
}

.alert--success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert--success .alert__icon {
    color: #22c55e;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

.auth-form {
    margin-bottom: 0;
}

/* Form Group */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

/* Form Input */
.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    color: #0f172a;
    background-color: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    outline: none;
}

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

.form-input:hover {
    border-color: #cbd5e1;
    background-color: #ffffff;
}

.form-input:focus {
    border-color: #2563eb;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-input--error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-input--error:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Password Input Wrapper */
.form-input-wrapper {
    position: relative;
}

.form-input--password {
    padding-left: 48px;
}

/* Password Toggle Button */
.password-toggle {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    outline: none;
}

.password-toggle:hover {
    color: #2563eb;
    background-color: #f1f5f9;
}

.password-toggle:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.password-toggle__icon {
    display: block;
    pointer-events: none;
}

/* Form Error */
.form-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 13px;
    color: #dc2626;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

.form-error svg {
    flex-shrink: 0;
}

/* ==========================================================================
   Form Options (Remember Me & Forgot Password)
   ========================================================================== */

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

/* Checkbox */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    accent-color: #2563eb;
}

.checkbox-input:hover {
    border-color: #2563eb;
}

.checkbox-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.checkbox-label {
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

/* Link */
.link {
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.link--primary {
    color: #2563eb;
}

.link--primary:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.link--primary:focus {
    outline: none;
    text-decoration: underline;
}

/* ==========================================================================
   Button Styles
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn--primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.btn--primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn--primary:focus {
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.2),
        0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.btn--block {
    width: 100%;
}

/* Button States */
.btn__text,
.btn__loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Spinner */
.spinner {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

.spinner__path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .auth-card {
        padding: 36px 28px;
    }

    .auth-card__title {
        font-size: 24px;
    }

    .auth-card__subtitle {
        font-size: 14px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    body {
        padding: 16px;
    }

    .auth-card {
        padding: 28px 20px;
    }

    .auth-card__title {
        font-size: 22px;
    }

    .form-input,
    .btn {
        padding: 12px 14px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    body {
        background: #ffffff;
    }

    .auth-card {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
}
