/* auth.css — dropdown-based auth UI */

/* Container: right-aligned, relative for dropdown positioning */
.auth-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 0 8px 0;
    position: relative;
}

/* ── Trigger button (logged-out) ── */
.auth-trigger-btn {
    padding: 6px 18px;
    background-color: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.auth-trigger-btn:hover {
    background-color: #45a049;
}

.auth-trigger-btn:focus-visible {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* ── Dropdown panel ── */
.auth-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    width: 300px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 20px;
    display: none;
}

.auth-dropdown.open {
    display: block;
}

/* ── Heading ── */
.auth-heading {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* ── Form ── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-field label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.auth-field input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.auth-field input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.15);
}

/* ── Password wrapper (for toggle overlay) ── */
.auth-password-wrapper {
    position: relative;
}

.auth-password-wrapper input {
    padding-right: 38px;
}

.auth-password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    color: #888;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
}

.auth-password-toggle:hover {
    color: #555;
}

.auth-password-toggle:focus-visible {
    outline: 2px solid #4CAF50;
    outline-offset: 1px;
    border-radius: 2px;
}

/* ── Hint text ── */
.auth-hint {
    font-size: 12px;
    color: #888;
    margin: 0;
}

/* ── Submit button ── */
.auth-submit-btn {
    padding: 9px 14px;
    background-color: #4CAF50;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s;
}

.auth-submit-btn:hover:not(:disabled) {
    background-color: #45a049;
}

.auth-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.auth-submit-btn:focus-visible {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* ── Toggle link ── */
.auth-toggle {
    background: none;
    border: none;
    color: #4790d8;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    text-decoration: underline;
    text-align: center;
}

.auth-toggle:hover {
    color: #3570b0;
}

/* ── Messages ── */
.auth-error {
    color: #e55a50;
    font-size: 13px;
    margin: 0;
    min-height: 0;
}

.auth-success {
    color: #4CAF50;
    font-size: 13px;
    margin: 0;
}

/* ── Logged-in state ── */
.auth-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #555;
}

.auth-user-email {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-logout-btn {
    padding: 4px 12px;
    background-color: #e55a50;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.auth-logout-btn:hover {
    background-color: #d04a40;
}

.auth-logout-btn:focus-visible {
    outline: 2px solid #e55a50;
    outline-offset: 2px;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .auth-container {
        margin: 0;
        padding: 0 10px 8px 10px;
    }

    .auth-dropdown {
        width: 100%;
        right: 0;
        left: 0;
        border-radius: 0 0 8px 8px;
        box-sizing: border-box;
    }
}
