/* Auth page styles - login, account pages */
/* Uses .container from common.css for the card effect */

.auth-container {
    max-width: 400px;
    margin: 0 auto;
    color: #333;
}

.auth-container h1 {
    font-family: var(--serif-font, Georgia, serif);
    font-size: 2rem;
    margin-bottom: 1rem;
    text-align: center;
    color: #333;
}

.auth-intro {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #666;
}

/* Method Toggle Switch */
.auth-method-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.auth-method-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
}

.auth-method-label:hover {
    color: #666;
}

.auth-method-label.active {
    color: #333;
}

.auth-switch {
    position: relative;
    width: 48px;
    height: 26px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.auth-switch-track {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #dee2e6;
    border-radius: 13px;
    transition: background-color 0.2s ease;
}

.auth-switch:hover .auth-switch-track {
    background-color: #ced4da;
}

.auth-switch.active .auth-switch-track {
    background-color: #3498db;
}

.auth-switch-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.auth-switch.active .auth-switch-thumb {
    transform: translateX(22px);
}

/* Auth Sections */
.auth-section {
    margin-bottom: 1.5rem;
}

.auth-section h2 {
    font-family: var(--serif-font, Georgia, serif);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.auth-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

/* Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
}

.form-group input {
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #ffffff;
    color: #333;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.form-group input::placeholder {
    color: #999;
    opacity: 0.8;
}

/* Buttons */
.auth-button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-button.primary {
    background-color: #3498db;
    color: white;
}

.auth-button.primary:hover:not(:disabled) {
    background-color: #2980b9;
}

.auth-button.secondary {
    background-color: transparent;
    color: #3498db;
    border: 1px solid #3498db;
}

.auth-button.secondary:hover:not(:disabled) {
    background-color: rgba(52, 152, 219, 0.05);
}

.auth-button.danger {
    background-color: #dc3545;
    color: white;
}

.auth-button.danger:hover:not(:disabled) {
    background-color: #c82333;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #666;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: #dee2e6;
}

.auth-divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
}

/* Messages */
.auth-message {
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.auth-message[hidden] {
    display: none;
}

.auth-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.auth-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.auth-message p {
    margin: 0 0 0.5rem 0;
}

.auth-message p:last-child {
    margin-bottom: 0;
}

.auth-note {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Privacy Section */
.auth-privacy {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.auth-privacy h3 {
    font-family: var(--serif-font, Georgia, serif);
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    color: #333;
}

.auth-privacy ul {
    margin: 0;
    padding-left: 1.25rem;
}

.auth-privacy li {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.auth-privacy-link {
    margin: 0.75rem 0 0 0;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
    font-size: 0.85rem;
    text-align: center;
}

.auth-privacy-link a {
    color: #3498db;
    text-decoration: none;
}

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

/* reCAPTCHA container */
#recaptcha-container {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
}

#recaptcha-container[hidden] {
    display: none;
}

/* Account Page Specific */
.account-container {
    max-width: 500px;
    margin: 0 auto;
    color: #333;
}

.account-header {
    text-align: center;
    margin-bottom: 2rem;
}

.account-header-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 0.25rem;
}

.account-header-icon svg {
    width: 40px;
    height: 40px;
    fill: #5b8fa8;
}

.account-header h1 {
    font-family: var(--serif-font, Georgia, serif);
    font-size: 2rem;
    margin: 0;
    color: #333;
}

.account-container h1 {
    font-family: var(--serif-font, Georgia, serif);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #333;
}

.account-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #dee2e6;
}

.account-section:last-child {
    border-bottom: none;
}

.account-section h2 {
    font-family: var(--serif-font, Georgia, serif);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #333;
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.account-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.account-info-label {
    color: #666;
}

/* Settings Form */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setting-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.setting-item input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    accent-color: #3498db;
}

.setting-label {
    flex: 1;
}

.setting-label strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #333;
}

.setting-label span {
    font-size: 0.875rem;
    color: #666;
}

/* Danger Zone */
.danger-zone {
    padding: 1rem;
    background-color: #fff5f5;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    text-align: center;
}

.danger-zone p {
    font-size: 0.875rem;
    color: #721c24;
    margin-bottom: 1rem;
}

/* Account Quick Links */
.account-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
}

.account-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    gap: 1rem;
}

.account-link:hover {
    border-color: #d4a537;
    background: #fefef9;
}

.account-link-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

/* Gold star for bookshelf link (uses fill) */
.account-link-icon svg[fill="currentColor"] {
    fill: #d4a537;
}

/* History icon uses blue/teal color */
.account-link-icon-history svg {
    fill: #5b8fa8;
}

.account-link-icon svg {
    width: 100%;
    height: 100%;
}

.account-link-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.account-link-title {
    font-weight: 600;
    color: #333;
}

.account-link-desc {
    font-size: 0.85rem;
    color: #888;
}

.account-link-arrow {
    color: #ccc;
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.account-link:hover .account-link-arrow {
    color: #d4a537;
    transform: translateX(3px);
}

/* Account Legal Links */
.account-legal-links {
    margin-top: 2rem;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: #999;
}

.account-legal-links a {
    color: #7f8c8d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.account-legal-links a:hover {
    color: #3498db;
    text-decoration: underline;
}

.account-legal-links .divider {
    margin: 0 0.5rem;
    color: #ccc;
}

/* Settings Saved Success Message */
.settings-saved-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    color: #155724;
    font-weight: 500;
    font-size: 0.95rem;
    animation: fadeInOut 4s ease-in-out forwards;
}

.settings-saved-message svg {
    flex-shrink: 0;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-10px); }
    10% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Centered Sign Out Button */
.account-section .auth-button.secondary#signout-btn {
    display: block;
    margin: 0 auto;
    width: fit-content;
}

/* =============================================================================
   SITE PREFERENCES
   ============================================================================= */

/* Preference Row - two column layout like account-info-row */
.preference-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.preference-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.preference-info strong {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.preference-info span {
    font-size: 0.8rem;
    color: #666;
}

/* Preference Toggle Pill - matches stories page toggle */
.preference-toggle-pill {
    display: inline-flex;
    align-items: center;
    background-color: #f0f3f6;
    border-radius: 20px;
    padding: 3px;
    gap: 2px;
    flex-shrink: 0;
}

.preference-toggle-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    border-radius: 16px;
    color: #95a5a6;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preference-toggle-option:hover:not(.active) {
    color: #5a6a7a;
    background-color: rgba(0, 0, 0, 0.05);
}

.preference-toggle-option.active {
    background-color: #ffffff;
    color: #3498db;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: default;
}

.preference-toggle-option svg {
    flex-shrink: 0;
}

/* Saving state feedback */
.preference-toggle-pill.saving .preference-toggle-option {
    pointer-events: none;
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-container,
    .account-container {
        max-width: 100%;
    }

    .auth-container h1,
    .account-container h1,
    .account-header h1 {
        font-size: 1.75rem;
    }
}
