/**
 * Auth UI Styles
 * Styles for user authentication modal and dropdown
 */

/* ============================================
   User Icon & Dropdown (Logged In)
   ============================================ */

.header-user-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
    font-size: 21px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    position: relative;
    letter-spacing: -6px;
    line-height: 1;
}

/* Match header action link hover colors */
.action-hover-color--golden .header-user-trigger:hover {
    color: #b19361;
}

.action-hover-color--green .header-user-trigger:hover {
    color: #047B42;
}

.action-hover-color--pink .header-user-trigger:hover {
    color: #ff365d;
}

.action-hover-color--aqua .header-user-trigger:hover {
    color: #66cec4;
}

.header-user-trigger i {
    font-size: 21px;
    letter-spacing: 0;
}

/* User Dropdown */
.header-action-link li {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.user-dropdown--active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.user-dropdown-greeting {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.user-dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.user-dropdown-menu li {
    margin: 0;
}

.user-dropdown-link {
    display: block;
    padding: 0.75rem 1.25rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 0.9rem;
}

.user-dropdown-link:hover {
    background-color: rgba(212, 165, 116, 0.1);
    color: var(--golden-color, #d4a574);
}

.user-dropdown-link--logout {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

/* Mobile dropdown adjustments */
.user-dropdown--mobile {
    right: auto;
    left: 0;
}

/* ============================================
   Auth Modal (Logged Out)
   ============================================ */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-modal--active {
    opacity: 1;
    visibility: visible;
}

.auth-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.auth-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    z-index: 1;
}

.auth-modal--active .auth-modal__dialog {
    transform: scale(1);
}

.auth-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.auth-modal__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.auth-modal__close {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #666;
    font-size: 1.5rem;
    line-height: 1;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal__close:hover {
    color: #333;
}

.auth-modal__body {
    padding: 1.5rem;
}

/* ============================================
   Auth Tabs
   ============================================ */

.auth-tabs {
    display: flex;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    gap: 0;
}

.auth-tabs__tab {
    flex: 1;
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.auth-tabs__tab:hover {
    color: #333;
}

.auth-tabs__tab--active {
    color: var(--golden-color, #d4a574);
    border-bottom-color: var(--golden-color, #d4a574);
}

/* ============================================
   Auth Tab Content
   ============================================ */

.auth-tab-content {
    display: none;
}

.auth-tab-content--active {
    display: block;
}

/* ============================================
   Auth Forms
   ============================================ */

.auth-form {
    margin-top: 1rem;
}

.auth-form__field {
    margin-bottom: 1.25rem;
}

.auth-form__field--inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-form__label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}

.auth-form__input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.auth-form__input:focus {
    outline: none;
    border-color: var(--golden-color, #d4a574);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.auth-form__password-wrapper {
    position: relative;
}

.auth-form__input--password {
    padding-right: 3rem;
}

.auth-form__toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #666;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.auth-form__toggle-password:hover {
    color: #333;
}

.auth-form__checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.auth-form__checkbox {
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.auth-form__link {
    background: none;
    border: none;
    padding: 0;
    color: var(--golden-color, #d4a574);
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.auth-form__link:hover {
    color: var(--golden-color, #d4a574);
    text-decoration: underline;
}

.auth-form__link--forgot {
    margin-left: auto;
}

.auth-form__submit {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.auth-form__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.auth-form__submit-loader {
    display: none;
    margin-left: 0.5rem;
}

.auth-form__submit:disabled .auth-form__submit-loader {
    display: inline-block;
}

/* ============================================
   Auth Messages
   ============================================ */

.auth-message {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    display: none;
}

.auth-message--visible {
    display: block;
}

.auth-message--error {
    background-color: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.auth-message--success {
    background-color: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

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

@media (max-width: 768px) {
    .auth-modal__dialog {
        width: 95%;
        max-height: 95vh;
        margin: 1rem;
    }

    .auth-modal__header {
        padding: 1.25rem;
    }

    .auth-modal__body {
        padding: 1.25rem;
    }

    .auth-tabs__tab {
        font-size: 0.85rem;
        padding: 0.625rem 0.75rem;
    }

    .user-dropdown {
        min-width: 200px;
        right: auto;
        left: 0;
    }

    .user-dropdown--mobile {
        left: 0;
        right: auto;
    }
}

@media (max-width: 480px) {
    .auth-modal__dialog {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .auth-form__field--inline {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-form__link--forgot {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* ============================================
   Password Toggle Icon States
   ============================================ */

.auth-form__toggle-password i.icon-eye {
    /* icon-eye is available in simple-line-icons */
}

.auth-form__toggle-password i.icon-close {
    /* Use icon-close as fallback when password is visible */
    font-size: 0.9em;
}

