/* Authentication Page Header Styling */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1,
.auth-header h2,
.auth-header .auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    letter-spacing: 0.5px;
}

.auth-header p,
.auth-header .auth-subtitle {
    color: #b0b8c3;
    font-size: 0.9rem;
    margin-bottom: 0;
    line-height: 1.4;
    font-weight: 400;
}

[data-theme="dark"] .auth-header h1,
[data-theme="dark"] .auth-header h2,
[data-theme="dark"] .auth-header .auth-title {
    color: #ffffff;
}

[data-theme="dark"] .auth-header p,
[data-theme="dark"] .auth-header .auth-subtitle {
    color: #b0b8c3;
}

/* Light theme adjustments */
[data-theme="light"] .auth-header h1,
[data-theme="light"] .auth-header h2,
[data-theme="light"] .auth-header .auth-title {
    color: #ffffff !important;
}

[data-theme="light"] .auth-header p,
[data-theme="light"] .auth-header .auth-subtitle {
    color: #b0b8c3 !important;
}

/* Default light theme (when no theme attribute is set) */
body .auth-header h1,
body .auth-header h2,
body .auth-header .auth-title,
body .auth-header .brand .brand-text {
    color: #ffffff !important;
}

body .auth-header p,
body .auth-header .auth-subtitle {
    color: #b0b8c3 !important;
}

/* Ensure visibility in card context */
.card .auth-header h1,
.card .auth-header h2,
.card .auth-header .auth-title,
.card .auth-header .brand .brand-text {
    color: #ffffff !important;
}

.card .auth-header p,
.card .auth-header .auth-subtitle {
    color: #b0b8c3 !important;
}

/* Brand/Logo styling in auth header */
.auth-header .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.auth-header .brand i {
    font-size: 1.25rem;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
    padding: 8px;
    border-radius: 6px;
}

.auth-header .brand .brand-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff !important;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .auth-header .brand .brand-text {
    color: #ffffff !important;
}

[data-theme="light"] .auth-header .brand .brand-text {
    color: #ffffff !important;
}

.auth-input-group {
    margin-bottom: 1rem;
    height: auto;
    display: flex;
    flex-direction: column;
}

.auth-input-group.mb-3 {
    margin-bottom: 1rem !important;
}

.auth-input-group.mb-2 {
    margin-bottom: 0.5rem !important;
}

.auth-input-group.no-margin {
    margin-bottom: 0 !important;
}

.auth-input-group .input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 48px;
}

.auth-input-group .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

[data-theme="dark"] .auth-input-group .form-label {
    color: #e2e8f0;
}

/* Light theme and default - force white color for labels */
[data-theme="light"] .auth-input-group .form-label,
body:not([data-theme="dark"]) .auth-input-group .form-label {
    color: #4a5568 !important;
}

.auth-input-group .input-group-text {
    background: #f8f9fa;
    border: 1px solid #ced4da;
    color: #495057;
    padding: 0 15px;
    border-radius: 6px 0 0 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
}

.auth-input-group .input-group-text i {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.auth-input-group .input-group.focused .input-group-text i {
    transform: scale(1.1);
    color: #8b5cf6;
}

.auth-input-group .input-group.success .input-group-text i {
    transform: scale(1.1);
    color: #28a745;
}

.auth-input-group .input-group.error .input-group-text i {
    animation: auth-input-shake 0.5s ease-in-out;
    color: #dc3545;
}

[data-theme="dark"] .auth-input-group .input-group-text {
    background: #374151;
    border-color: #4a5568;
    color: #9ca3af;
}

[data-theme="dark"] .auth-input-group .input-group.focused .input-group-text i {
    color: #8b5cf6;
}

[data-theme="dark"] .auth-input-group .input-group.success .input-group-text i {
    color: #48bb78;
}

[data-theme="dark"] .auth-input-group .input-group.error .input-group-text i {
    color: #f87171;
}

@keyframes auth-input-shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px) rotate(-5deg);
    }

    75% {
        transform: translateX(5px) rotate(5deg);
    }
}

.auth-input-group .form-control {
    border: 1px solid #ced4da;
    border-left: none;
    border-radius: 0;
    transition: all 0.3s ease;
    padding: 0 15px;
    font-size: 14px;
    flex: 1;
    height: 48px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    background-color: #ffffff !important;
    color: #1a202c !important;
    font-weight: 500;
}

.auth-input-group .input-group .form-control:not(:last-child) {
    border-radius: 0;
}

.auth-input-group .input-group .form-control:last-child {
    border-radius: 0 6px 6px 0;
}

.auth-input-group .form-control:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 0.2rem rgba(139, 92, 246, 0.25);
    outline: none;
    background-color: #ffffff !important;
    color: #1a202c !important;
}

.auth-input-group .form-control::placeholder {
    color: #4a5568 !important;
    opacity: 1 !important;
    font-weight: 400;
}

.auth-input-group .form-control::-webkit-input-placeholder {
    color: #4a5568 !important;
    opacity: 1 !important;
    font-weight: 400;
}

.auth-input-group .form-control::-moz-placeholder {
    color: #4a5568 !important;
    opacity: 1 !important;
    font-weight: 400;
}

.auth-input-group .form-control:-ms-input-placeholder {
    color: #4a5568 !important;
    opacity: 1 !important;
    font-weight: 400;
}

.auth-input-group .input-group.success .form-control {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.05);
}

.auth-input-group .input-group.error .form-control {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.05);
}

[data-theme="dark"] .auth-input-group .form-control {
    background-color: #374151;
    border-color: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .auth-input-group .form-control:focus {
    background-color: #374151;
    border-color: #8b5cf6;
    color: #e2e8f0;
    box-shadow: 0 0 0 0.2rem rgba(139, 92, 246, 0.25);
}

[data-theme="dark"] .auth-input-group .input-group.success .form-control {
    border-color: #48bb78;
    background-color: rgba(72, 187, 120, 0.1);
}

[data-theme="dark"] .auth-input-group .input-group.error .form-control {
    border-color: #f87171;
    background-color: rgba(248, 113, 113, 0.1);
}

.auth-input-group .validation-message {
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease;
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.auth-input-group .validation-message.show {
    height: auto;
    min-height: 20px;
}

.auth-input-group .validation-message.success {
    color: #28a745;
}

.auth-input-group .validation-message.error {
    color: #dc3545;
}

[data-theme="dark"] .auth-input-group .validation-message {
    color: #9ca3af;
}

[data-theme="dark"] .auth-input-group .validation-message.success {
    color: #48bb78;
}

[data-theme="dark"] .auth-input-group .validation-message.error {
    color: #f87171;
}

/* Password toggle button */
.auth-input-group .toggle-password {
    border: 1px solid #ced4da;
    border-left: none;
    border-radius: 0 6px 6px 0;
    background: #f8f9fa;
    color: #6c757d;
    padding: 0 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 3;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
}

.auth-input-group .toggle-password:hover {
    background: #e9ecef;
    color: #495057;
}

.auth-input-group .toggle-password:focus {
    box-shadow: 0 0 0 0.2rem rgba(139, 92, 246, 0.25);
    border-color: #8b5cf6;
    outline: none;
}

.auth-input-group .toggle-password:active {
    background: #dee2e6;
    transform: none;
}

[data-theme="dark"] .auth-input-group .toggle-password {
    background: #374151;
    border-color: #4a5568;
    color: #9ca3af;
}

[data-theme="dark"] .auth-input-group .toggle-password:hover {
    background: #4b5563;
    color: #e2e8f0;
}

/* Form control validation styling */

.auth-input-group .form-control.is-valid {
    border-color: #28a745;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.94-.94 1.76 1.76 4.76-4.76.94.94L6.03 7.47z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.auth-input-group .form-control.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 3.6.7.7 1.4 1.4.7.7M6.2 8.4l-.7-.7-1.4-1.4-.7-.7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

[data-theme="dark"] .auth-input-group .validation-message {
    color: #f87171;
}

[data-theme="dark"] .auth-input-group .form-control.is-valid {
    border-color: #48bb78;
}

[data-theme="dark"] .auth-input-group .form-control.is-invalid {
    border-color: #f87171;
}

/* Focus effects */
.auth-input-group .input-group.focused {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

[data-theme="dark"] .auth-input-group .input-group.focused {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

/* Responsive design */
@media (max-width: 576px) {
    .auth-input-group .input-group {
        height: 44px;
    }

    .auth-input-group .form-control,
    .auth-input-group .input-group-text,
    .auth-input-group .toggle-password {
        padding: 0 12px;
        font-size: 14px;
        height: 44px;
    }

    .auth-input-group .input-group-text,
    .auth-input-group .toggle-password {
        min-width: 44px;
    }

    .auth-header h1,
    .auth-header h2,
    .auth-header .auth-title {
        font-size: 1.25rem;
    }

    .auth-header p,
    .auth-header .auth-subtitle {
        font-size: 0.85rem;
    }

    .auth-header .brand .brand-text {
        font-size: 1.25rem;
    }

    .auth-header .brand i {
        font-size: 1rem;
        padding: 6px;
    }
}

/* Additional contrast improvements for light theme */
.auth-input-group .form-control {
    border-color: #d1d5db;
}

.auth-input-group .input-group-text {
    border-color: #d1d5db;
    background: #f9fafb;
}

.auth-input-group .toggle-password {
    border-color: #d1d5db;
    background: #f9fafb;
}

/* Force visibility for all header elements in light/default theme */
html .auth-header .brand-text,
html .card-header .brand-text {
    color: #ffffff !important;
    text-shadow: none !important;
}

html .auth-header .auth-subtitle,
html .card-header .auth-subtitle {
    color: #b0b8c3 !important;
    text-shadow: none !important;
}

/* Only override to white in dark theme */
html[data-theme="dark"] .auth-header .brand-text,
html[data-theme="dark"] .card-header .brand-text {
    color: #ffffff !important;
}

html[data-theme="dark"] .auth-header .auth-subtitle,
html[data-theme="dark"] .card-header .auth-subtitle {
    color: #b0b8c3 !important;
}

/* Force text visibility in all input states */
.auth-input-group input[type="text"],
.auth-input-group input[type="email"],
.auth-input-group input[type="password"],
.auth-input-group input[type="url"] {
    color: #1a202c !important;
    background-color: #ffffff !important;
    font-weight: 500 !important;
    -webkit-text-fill-color: #1a202c !important;
    opacity: 1 !important;
    -webkit-opacity: 1 !important;
}

.auth-input-group input[type="text"]:focus,
.auth-input-group input[type="email"]:focus,
.auth-input-group input[type="password"]:focus,
.auth-input-group input[type="url"]:focus {
    color: #1a202c !important;
    background-color: #ffffff !important;
    -webkit-text-fill-color: #1a202c !important;
}

/* Dark theme overrides for inputs */
[data-theme="dark"] .auth-input-group input[type="text"],
[data-theme="dark"] .auth-input-group input[type="email"],
[data-theme="dark"] .auth-input-group input[type="password"],
[data-theme="dark"] .auth-input-group input[type="url"] {
    color: #e5e7eb !important;
    background-color: #374151 !important;
    -webkit-text-fill-color: #e5e7eb !important;
}

[data-theme="dark"] .auth-input-group input[type="text"]:focus,
[data-theme="dark"] .auth-input-group input[type="email"]:focus,
[data-theme="dark"] .auth-input-group input[type="password"]:focus,
[data-theme="dark"] .auth-input-group input[type="url"]:focus {
    color: #e5e7eb !important;
    background-color: #374151 !important;
    -webkit-text-fill-color: #e5e7eb !important;
}

[data-theme="dark"] .auth-input-group input::placeholder {
    color: #9ca3af !important;
    -webkit-text-fill-color: #9ca3af !important;
}