/* Auth + member profile — matches Enchanted Court palette */
/* Do not set background here: let body rules in home-enchanted.css apply (background-of.webp) */
.auth-enchanted-body {
    margin: 0;
    min-height: 100vh;
    color: var(--text-pale, #e8d5a8);
}

/* Sticky footer: short pages keep footer at viewport bottom */
body.auth-enchanted-body .page-wrapper.auth-page-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.auth-enchanted-body .auth-page-wrap .auth-main {
    flex: 1 1 auto;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem max(1.25rem, env(safe-area-inset-left)) 3rem max(1.25rem, env(safe-area-inset-right));
    padding-bottom: max(3rem, env(safe-area-inset-bottom));
}

body.auth-enchanted-body .auth-page-wrap #footer {
    flex-shrink: 0;
    margin-top: auto;
}

.auth-card {
    width: min(440px, 100%);
    margin: 0 auto;
    padding: 28px 28px 26px;
    border-radius: 8px;
    border: 1px solid rgba(122, 85, 32, 0.35);
    background: linear-gradient(160deg, #1c150a 0%, #141008 100%);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 1px rgba(201, 146, 42, 0.2);
}

.auth-card h1 {
    margin: 0 0 6px;
    font-family: 'Cinzel Decorative', serif;
    font-size: 22px;
    font-weight: 400;
    color: #e8b84b;
    text-shadow: 0 0 20px rgba(201, 146, 42, 0.4);
    letter-spacing: 0.04em;
}

.auth-card .lead {
    margin: 0 0 1.25rem;
    color: rgba(208, 185, 140, 0.55);
    font-size: 14px;
    font-style: italic;
}

.auth-card label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 9px;
    letter-spacing: 0.14em;
    color: rgba(208, 185, 140, 0.55);
    text-transform: uppercase;
    margin: 0.85rem 0 0.35rem;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"],
.auth-card input[type="file"],
.auth-card textarea,
.auth-card select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid rgba(122, 85, 32, 0.35);
    background: rgba(15, 9, 3, 0.85);
    color: #e8d5a8;
    font-family: 'EB Garamond', serif;
    font-size: 15px;
}

.auth-card textarea {
    min-height: 88px;
    resize: vertical;
}

.auth-card input:focus,
.auth-card textarea:focus,
.auth-card select:focus {
    outline: none;
    border-color: rgba(201, 146, 42, 0.55);
}

.auth-card .remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
    font-size: 14px;
    color: rgba(208, 185, 140, 0.55);
}

.auth-card .remember input {
    width: auto;
}

.auth-card button[type="submit"],
.auth-card .btn-gold {
    margin-top: 1.25rem;
    width: 100%;
    padding: 10px 16px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    background: linear-gradient(135deg, #e8b84b, #c9922a);
    color: #1a0a00;
    box-shadow: 0 0 14px rgba(201, 146, 42, 0.3);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.auth-card button[type="submit"]:hover,
.auth-card .btn-gold:hover {
    box-shadow: 0 0 22px rgba(201, 146, 42, 0.45);
}

.auth-links {
    margin-top: 1rem;
    text-align: center;
    font-size: 14px;
    font-style: italic;
}

.auth-links a {
    color: #e8b84b;
}

.auth-err {
    color: #e88;
    font-size: 14px;
    margin-top: 0.75rem;
}

.auth-status {
    margin-top: 0.75rem;
    color: #8ab84a;
    font-size: 14px;
}

/* Profile */
.profile-layout {
    display: grid;
    grid-template-columns: minmax(200px, 240px) 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 820px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
}

.profile-tabs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(122, 85, 32, 0.35);
    background: rgba(20, 16, 8, 0.6);
}

.profile-tabs a {
    display: block;
    padding: 10px 12px;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(208, 185, 140, 0.75);
    text-decoration: none;
    border: 1px solid transparent;
}

.profile-tabs a:hover {
    color: #e8d5a8;
    border-color: rgba(122, 85, 32, 0.4);
}

.profile-tabs a.active {
    color: #0a0602;
    background: linear-gradient(135deg, #e8b84b, #c9922a);
    border-color: rgba(201, 146, 42, 0.5);
}

/* Sidebar nav: override auth-main link colors so active tab + visited stay readable */
.auth-main .profile-tabs a,
.auth-main .profile-tabs a:visited {
    color: rgba(208, 185, 140, 0.75);
}

.auth-main .profile-tabs a:hover {
    color: #e8d5a8;
}

.auth-main .profile-tabs a.active,
.auth-main .profile-tabs a.active:visited {
    color: #0a0602;
}

.auth-main .profile-tabs a.active:hover {
    color: #0a0602;
}

.profile-tabs-logout {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(122, 85, 32, 0.35);
}

.profile-logout-form {
    margin: 0;
}

.profile-tab-logout-btn {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    color: rgba(208, 185, 140, 0.85);
    background: rgba(8, 5, 2, 0.5);
    border: 1px solid rgba(122, 85, 32, 0.45);
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.profile-tab-logout-btn:hover {
    color: #e8d5a8;
    border-color: rgba(201, 146, 42, 0.55);
    background: rgba(201, 146, 42, 0.08);
}

.profile-panel {
    padding: 20px 22px;
    border-radius: 8px;
    border: 1px solid rgba(122, 85, 32, 0.35);
    background: linear-gradient(160deg, #1c150a 0%, #141008 100%);
    min-height: 320px;
}

.profile-panel h2 {
    margin: 0 0 1rem;
    font-family: 'Cinzel Decorative', serif;
    font-size: 18px;
    color: #e8b84b;
    font-weight: 400;
}

.profile-panel .muted {
    color: rgba(208, 185, 140, 0.55);
    font-size: 15px;
    line-height: 1.5;
}

/* Horizontal scroll on small screens so wide tables don’t break layout */
.profile-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 0 4px 6px;
}

.profile-table-scroll .profile-table {
    min-width: 560px;
}

.profile-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.profile-table th,
.profile-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(122, 85, 32, 0.25);
}

.profile-table th {
    font-family: 'Cinzel', serif;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(208, 185, 140, 0.55);
}

.profile-table a {
    color: #e8b84b;
}

/* Inline links in profile / auth main (avoid default browser blue) */
.auth-main a {
    color: var(--gold-light, #e8b84b);
    text-decoration: none;
    border-bottom: 1px solid rgba(201, 146, 42, 0.35);
    transition: color 0.2s, border-color 0.2s;
}

.auth-main a:visited {
    color: var(--gold-light, #e8b84b);
}

.auth-main a:hover {
    color: var(--gold-bright, #f5d070);
    border-bottom-color: rgba(201, 146, 42, 0.55);
}

.auth-main .muted a {
    color: var(--gold-light, #e8b84b);
}

.pill-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-family: 'Cinzel', serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(201, 146, 42, 0.15);
    border: 1px solid rgba(122, 85, 32, 0.4);
}

.pill-status--active {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.45);
    color: #86efac;
}

.profile-cancel-subscription-form {
    margin-top: 1.35rem;
    max-width: 420px;
}

.profile-cancel-subscription-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 220px;
    padding: 12px 24px;
    border-radius: 999px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    color: rgba(254, 226, 226, 0.95);
    background: transparent;
    border: 1px solid rgba(248, 113, 113, 0.55);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.profile-cancel-subscription-btn:hover {
    background: rgba(185, 28, 28, 0.18);
    border-color: rgba(248, 113, 113, 0.85);
    box-shadow: 0 0 20px rgba(248, 113, 113, 0.15);
}

.avatar-preview {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(122, 85, 32, 0.45);
    margin-bottom: 10px;
}

.profile-form-grid {
    display: grid;
    gap: 0.5rem 1rem;
    max-width: 420px;
}

/* Enchanted form controls (profile basic tab) */
.profile-form-enchanted .profile-field-label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 9px;
    letter-spacing: 0.14em;
    color: rgba(208, 185, 140, 0.55);
    text-transform: uppercase;
    margin: 0.75rem 0 0.4rem;
}

.profile-form-enchanted .profile-field-label:first-of-type {
    margin-top: 0;
}

.profile-form-enchanted .profile-input,
.profile-form-enchanted select.profile-input {
    width: 100%;
    max-width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid rgba(122, 85, 32, 0.45);
    background:
        linear-gradient(180deg, rgba(22, 16, 8, 0.95) 0%, rgba(12, 9, 4, 0.98) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    color: #e8d5a8;
    font-family: 'EB Garamond', serif;
    font-size: 16px;
    line-height: 1.35;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-form-enchanted select.profile-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23c9922a' d='M1 1.5L6 6l5-4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.profile-form-enchanted .profile-input::placeholder {
    color: rgba(208, 185, 140, 0.35);
}

.profile-form-enchanted .profile-input:hover,
.profile-form-enchanted select.profile-input:hover {
    border-color: rgba(201, 146, 42, 0.4);
}

.profile-form-enchanted .profile-input:focus,
.profile-form-enchanted select.profile-input:focus {
    outline: none;
    border-color: rgba(201, 146, 42, 0.65);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 0 0 1px rgba(201, 146, 42, 0.2);
}

.profile-form-enchanted .profile-file-input {
    width: 100%;
    max-width: 100%;
    padding: 8px 0;
    font-family: 'EB Garamond', serif;
    font-size: 14px;
    color: rgba(208, 185, 140, 0.75);
    border: none;
    background: transparent;
    cursor: pointer;
}

.profile-form-enchanted .profile-file-input::file-selector-button {
    margin-right: 14px;
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid rgba(201, 146, 42, 0.45);
    background: linear-gradient(180deg, rgba(232, 184, 75, 0.2) 0%, rgba(201, 146, 42, 0.08) 100%);
    box-shadow: 0 0 12px rgba(201, 146, 42, 0.15);
    color: #e8d5a8;
    font-family: 'Cinzel', serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.profile-form-enchanted .profile-file-input::file-selector-button:hover {
    border-color: rgba(232, 184, 75, 0.65);
    box-shadow: 0 0 18px rgba(201, 146, 42, 0.25);
}

.profile-form-enchanted .profile-file-input::-webkit-file-upload-button {
    margin-right: 14px;
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid rgba(201, 146, 42, 0.45);
    background: linear-gradient(180deg, rgba(232, 184, 75, 0.2) 0%, rgba(201, 146, 42, 0.08) 100%);
    color: #e8d5a8;
    font-family: 'Cinzel', serif;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
}

.profile-form-enchanted .profile-submit-btn {
    margin-top: 0.75rem;
    width: auto;
    min-width: 200px;
    padding: 12px 28px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 9.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    background: linear-gradient(135deg, #e8b84b, #c9922a);
    color: #1a0a00;
    box-shadow: 0 0 16px rgba(201, 146, 42, 0.35);
    transition: box-shadow 0.2s;
}

.profile-form-enchanted .profile-submit-btn:hover {
    box-shadow: 0 0 24px rgba(201, 146, 42, 0.5);
}

hr.profile-divider {
    border: none;
    border-top: 1px solid rgba(122, 85, 32, 0.3);
    margin: 1.5rem 0;
}

.nav-logout-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.nav-logout-form button {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
    padding: 0;
}

.nav-links .nav-logout-form button.nav-login {
    background: transparent;
}
