/* ====================================
   Modern Authentication Pages CSS
   Simple, Clean, and Responsive Design
   ==================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--app-primary-muted, #315A82) 0%, var(--app-primary-strong, #142A45) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.auth-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.4s ease-out;
}

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

.auth-header {
    background: linear-gradient(135deg, var(--app-primary-muted, #315A82) 0%, var(--app-primary-strong, #142A45) 100%);
    padding: 40px 30px;
    text-align: center;
    color: #ffffff;
}

.auth-logo {
    margin-bottom: 20px;
}

.auth-logo img {
    max-width: 120px;
    height: auto;
    filter: brightness(0) invert(1);
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
}

.auth-body {
    padding: 40px 30px;
}

.form-group {
    margin-bottom: 24px;
}

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

.form-group label .required {
    color: #ef4444;
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #1f2937;
}

.form-control:focus {
    outline: none;
    border-color: var(--app-primary-muted, #315A82);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-control.is-invalid {
    border-color: #ef4444;
}

.invalid-feedback {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #ef4444;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.btn {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--app-primary-muted, #315A82) 0%, var(--app-primary-strong, #142A45) 100%);
    color: #ffffff;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert i {
    font-size: 18px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.auth-footer {
    padding: 20px 30px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.auth-footer a {
    color: var(--app-primary-muted, #315A82);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: var(--app-primary-strong, #142A45);
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #374151;
}

.back-link i {
    font-size: 12px;
}

.form-divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.form-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e5e7eb;
}

.form-divider span {
    background: #ffffff;
    padding: 0 12px;
    font-size: 13px;
    color: #6b7280;
    position: relative;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-wrapper label {
    margin: 0;
    font-weight: 400;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 576px) {
    body {
        padding: 10px;
    }

    .auth-card {
        border-radius: 12px;
    }

    .auth-header {
        padding: 30px 20px;
    }

    .auth-header h1 {
        font-size: 24px;
    }

    .auth-header p {
        font-size: 13px;
    }

    .auth-body {
        padding: 30px 20px;
    }

    .auth-footer {
        padding: 16px 20px;
    }

    .form-control {
        padding: 11px 14px;
        font-size: 14px;
    }

    .btn-primary {
        padding: 12px;
        font-size: 15px;
    }
}

@media (max-width: 380px) {
    .auth-header h1 {
        font-size: 22px;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* Loading State */
.btn-primary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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