/**
 * Auth Modal Component CSS
 * Login and Register modals
 */

/* Modal Base */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

.auth-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Overlay */
.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Modal Content */
.auth-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 440px;
    max-height: 95vh;
    overflow-y: visible;
    padding: 1.75rem 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    z-index: 10001;
}

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

/* Close Button */
.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    transition: color 0.2s;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.auth-modal-close:hover {
    color: var(--gray-700);
    background: var(--gray-100);
}

/* Modal Header */
.auth-modal-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.auth-modal-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--gray-900);
    margin: 0 0 0.5rem;
}

.auth-modal-header p {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin: 0;
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    border: 1.5px solid var(--gray-300);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: var(--font-size-sm);
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
    background: white;
}

.form-control:hover {
    border-color: var(--gray-400);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 247, 87, 0), 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-help {
    display: block;
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    margin-top: -0.25rem;
}

/* Form Row (2 columns) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
    align-items: center;
}

@media (max-width: 480px) {
    .form-row:has(.form-group) {
        grid-template-columns: 1fr;
    }
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: var(--font-size-xs);
    color: var(--gray-600);
    cursor: pointer;
    margin: 0;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.125rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label a {
    color: var(--primary);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Link */
.link-primary {
    color: var(--primary);
    text-decoration: none;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
}

.link-primary:hover {
    text-decoration: underline;
}

/* Button */
.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.875rem 1.25rem;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark, #e64f00);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(var(--primary-rgb, 247, 87, 0), 0.3);
}

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

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 0.625rem 0 0.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-200);
}

.auth-divider span {
    padding: 0 0.75rem;
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

/* Switch Link */
.auth-switch {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    margin: 0;
}

.auth-switch a {
    color: var(--primary);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Error Message */
.auth-error {
    background: var(--red-50, #fef2f2);
    color: var(--red-700, #b91c1c);
    border: 1px solid var(--red-500, #ef4444);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    font-size: var(--font-size-sm);
    line-height: var(--line-height-tight);
}

/* Header Auth Buttons */
.auth-buttons {
    display: none;
    align-items: center;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .auth-buttons {
        display: flex;
    }
}

.btn-link {
    background: none;
    border: none;
    color: var(--gray-700);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    font-family: inherit;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    font-family: inherit;
    cursor: pointer;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-primary:hover {
    background: var(--primary-dark, #e64f00);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb, 247, 87, 0), 0.25);
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    background: white;
    border: 1.5px solid var(--gray-200);
    color: var(--gray-700);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    font-family: inherit;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-menu-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.125rem);
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    min-width: 160px;
    padding: 0.125rem;
    display: none;
    flex-direction: column;
    z-index: 1000;
}

.user-menu:hover .user-dropdown,
.user-menu-toggle:focus + .user-dropdown {
    display: flex;
}

.user-dropdown a {
    color: var(--gray-700);
    text-decoration: none;
    padding: 0.375rem 0.625rem;
    border-radius: 3px;
    transition: background 0.12s;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.user-dropdown a svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.7;
}

.user-dropdown a:hover svg {
    opacity: 1;
}

.user-dropdown a:hover {
    background: var(--gray-100);
}

.user-dropdown a.text-danger {
    color: var(--red-500, #ef4444);
}

.user-dropdown a.text-danger:hover {
    background: var(--red-50, #fef2f2);
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .auth-modal-content {
        padding: 1.5rem 1.25rem;
        border-radius: 12px;
        width: 95%;
    }
    
    .auth-modal-header h2 {
        font-size: var(--font-size-xl);
    }
}

