/* Enhanced Teckid Kenya Login Page Styles */

:root {
    --primary-color: #8c0fd4;
    --primary-hover: #9e17be;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --border-focus: #8c0fd4;
    --background-light: #f8fafc;
    --white: #ffffff;
    --error-color: #ef4444;
    --success-color: #10b981;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1),
        0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
        0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1),
        0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* Body and layout enhancements */
body.auth-body-bg {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
    /* Keep original background - don't override */
    min-height: 100vh;
    padding: 20px;
}

/* Don't hide the background overlay */
.bg-overlay {
    /* Keep original overlay visible */
}

.wrapper-page {
    width: 100%;
    max-width: 420px;
    /* Keep original positioning - don't force center */
}

/* Card enhancements */
.card {
    background: var(--white);
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.3s ease;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
}

.card:hover {
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.card-body {
    padding: 2.5rem;
}

/* Logo enhancements */
.auth-logo {
    display: inline-block;
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease;
}

.auth-logo:hover {
    transform: scale(1.05);
}

.auth-logo img {
    transition: all 0.2s ease;
}

/* Typography enhancements */
h3.text-muted {
    color: var(--text-primary) !important;
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 2rem;
    letter-spacing: -0.025em;
}

/* Form styling enhancements */
.form-horizontal .form-control {
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--white);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.form-horizontal .form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgb(140 15 212 / 0.1);
    outline: none;
}

.form-horizontal .form-control:hover:not(:focus) {
    border-color: #d1d5db;
}

.form-horizontal .form-control::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
}

/* Password field styling */
.position-relative .form-control {
    padding-right: 3rem;
}

/* Eye icon styling */
#password-eye-icon {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.125rem;
    transition: color 0.2s ease;
    z-index: 10;
}

#password-eye-icon:hover {
    color: var(--primary-color);
}

/* Checkbox styling */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--white);
    transition: all 0.2s ease;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgb(140 15 212 / 0.1);
    border-color: var(--primary-color);
}

.form-check-label {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.875rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.form-check-input:checked ~ .form-check-label {
    color: var(--text-primary);
}

/* Button styling */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
    font-weight: 600;
    font-size: 1rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    border: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn-primary::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: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 0 0 3px rgb(140 15 212 / 0.2);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Link styling */
a.text-muted {
    color: var(--text-secondary) !important;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

a.text-muted:hover {
    color: var(--primary-color) !important;
    text-decoration: underline;
}

a.text-muted i {
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

a.text-muted:hover i {
    transform: scale(1.1);
}

/* Alert styling */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.alert-danger {
    background-color: #fef2f2;
    color: #f32f53;
    border-left: 4px solid var(--error-color);
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border-left: 4px solid var(--success-color);
}

.alert ul {
    margin: 0;
    padding-left: 1.25rem;
}

.alert li {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Form validation styling */
.form-control.is-invalid {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgb(239 68 68 / 0.1);
}

.invalid-feedback {
    display: block;
    color: var(--error-color);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
    margin-left: 0.25rem;
}

/* Hide eye icon when there's an error */
.form-group .invalid-feedback + #password-eye-icon,
.form-group .is-invalid + #password-eye-icon {
    display: none !important;
}

/* Form group spacing */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* Address dropdown styling */
#addressDropdown {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    background-color: var(--white);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

#addressDropdown:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgb(140 15 212 / 0.1);
    outline: none;
}

/* Animation classes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.6s ease-out;
}

/* Loading state */
.btn-primary:disabled {
    background-color: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.btn-primary:disabled:hover {
    background-color: #9ca3af;
    border-color: #9ca3af;
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* Focus visible for accessibility */
.form-control:focus-visible,
.btn:focus-visible,
.form-check-input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Responsive design adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 2rem 1.5rem;
    }

    .form-horizontal .form-control {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    #password-eye-icon {
        font-size: 1rem;
        right: 0.875rem;
    }

    h3.text-muted {
        font-size: 1.375rem;
        margin-bottom: 1.5rem;
    }

    .wrapper-page {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    body.auth-body-bg {
        padding: 10px;
    }

    .card-body {
        padding: 1.5rem 1.25rem;
    }

    .btn-primary {
        padding: 0.75rem 1.25rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-control {
        border-width: 2px;
    }

    .btn-primary {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
