/* ==========================================================================
   Account Icon + Login Dropdown Panel
   ========================================================================== */

/* ═══════════════════════════════════════════════
   ACCOUNT ICON + LOGIN DROPDOWN PANEL
   ═══════════════════════════════════════════════ */

.account-dropdown-wrap {
    position: relative;
    flex-shrink: 0;
}

/* Account icon button */
.account-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--ui-panel-border);
    background: var(--ui-button);
    color: var(--ui-fg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
}

.account-icon-btn:hover {
    background: var(--ui-button-hover);
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.18);
}

.account-icon-btn.active {
    background: #1d4ed8;
    border-color: #3b82f6;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.22);
}

/* Panel container */
.account-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: var(--ui-panel);
    border: 1px solid var(--ui-panel-border);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.3);
    z-index: 9999;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.account-panel {
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.1);
}

.account-panel.ap-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Tabs */
.ap-tabs {
    display: flex;
    border-bottom: 1px solid var(--ui-panel-border);
    background: var(--ui-bg);
}

.ap-tab {
    flex: 1;
    padding: 12px 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ui-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.14s ease, background 0.14s ease;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.ap-tab:hover {
    color: var(--ui-fg);
    background: var(--ui-button-hover);
}

.ap-tab-active {
    color: var(--ui-fg);
    font-weight: 700;
    position: relative;
}

.ap-tab-active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: #3b82f6;
    border-radius: 2px 2px 0 0;
}

/* Body */
.ap-body {
    padding: 24px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ap-body-hidden {
    display: none;
}

/* Branding */
.ap-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2px;
}

.ap-brand-name {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ap-subtitle {
    text-align: center;
    font-size: 12.5px;
    color: var(--ui-muted);
    margin: 0;
    line-height: 1.4;
}

/* Input fields */
.ap-field-wrap {
    position: relative;
}

.ap-input {
    width: 100%;
    height: 42px;
    background: var(--ui-button);
    border: 1.5px solid var(--ui-panel-border);
    border-radius: 8px;
    color: var(--ui-fg);
    font-size: 13.5px;
    font-family: inherit;
    padding: 0 40px 0 14px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ap-input::placeholder {
    color: var(--ui-muted);
}

.ap-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
    background: var(--ui-button-hover);
}

/* Password toggle */
.ap-field-pw .ap-input {
    padding-right: 42px;
}

.ap-pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--ui-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.12s ease;
}

.ap-pw-toggle:hover {
    color: var(--ui-fg);
}

/* Forgot link */
.ap-forgot {
    font-size: 12px;
    color: #3b82f6;
    text-align: center;
    text-decoration: none;
    display: block;
    margin-top: -4px;
    transition: color 0.12s ease;
}

.ap-forgot:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* Submit button */
.ap-submit-btn {
    width: 100%;
    height: 42px;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: opacity 0.14s ease, box-shadow 0.14s ease, transform 0.1s ease;
    box-shadow: 0 4px 14px rgba(34,197,94,0.35);
}

.ap-submit-btn:hover {
    opacity: 0.92;
    box-shadow: 0 6px 20px rgba(34,197,94,0.45);
    transform: translateY(-1px);
}

.ap-submit-btn:active {
    transform: translateY(0);
    opacity: 1;
}

/* Terms text */
.ap-terms {
    font-size: 11px;
    color: var(--ui-muted);
    text-align: center;
    margin: -4px 0 0;
    line-height: 1.5;
}

.ap-terms a {
    color: #3b82f6;
    text-decoration: none;
}

.ap-terms a:hover {
    text-decoration: underline;
}

/* Arrow pointer on panel */
.account-panel::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 14px;
    width: 12px;
    height: 12px;
    background: var(--ui-bg);
    border-left: 1px solid var(--ui-panel-border);
    border-top: 1px solid var(--ui-panel-border);
    transform: rotate(45deg);
    border-radius: 2px 0 0 0;
}

/* Responsive: make panel full-width on small screens */
@media (max-width: 400px) {
    .account-panel {
        right: -8px;
        width: calc(100vw - 16px);
    }
}
