﻿/* ============================================= */
/* ===== Auth — Login, Profile, Sync              */
/* ============================================= */

/* --- Auth Header Button --- */
.auth-header-btn {
    position: relative;
    padding: 6px 14px !important;
}

.auth-header-btn .auth-avatar {
    border: 2px solid var(--progress-done-bg);
}

.auth-sync-dot {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid white;
    display: none;
}

.auth-sync-dot.sync-ok {
    display: block;
    background: var(--progress-done-bg);
}

.auth-sync-dot.sync-pending {
    display: block;
    background: var(--grade-mid);
    animation: syncPulse 1.2s infinite;
}

.auth-sync-dot.sync-error {
    display: block;
    background: var(--danger-color);
}

@keyframes syncPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* --- Auth Modal --- */
.auth-provider-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: white;
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.auth-provider-btn:hover {
    border-color: #adb5bd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.auth-provider-btn:active {
    transform: translateY(0);
}

.auth-provider-btn svg {
    flex-shrink: 0;
}

.auth-skip-btn {
    display: inline-block;
    margin-top: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

.auth-skip-btn:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

/* --- Profile Menu --- */
.auth-profile-menu {
    position: fixed;
    z-index: 2500;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 220px;
    direction: rtl;
    font-family: var(--font-family);
}

.auth-profile-email {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-all;
}

.auth-profile-sync {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.auth-profile-action {
    display: block;
    width: 100%;
    text-align: right;
    background: none;
    border: none;
    padding: 10px 8px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
}

.auth-profile-action:hover {
    background: var(--bg-main);
}

.auth-logout-action {
    color: var(--danger-color);
}

.auth-logout-action:hover {
    background: #fef2f2;
}

/* --- CTA Banner --- */
.auth-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1200;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(13, 110, 253, 0.35);
    animation: bannerSlideUp 0.5s ease-out;
    white-space: nowrap;
}

@keyframes bannerSlideUp {
    from { transform: translateX(-50%) translateY(100px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.auth-banner-login-btn {
    background: white;
    color: #0d6efd;
    border: none;
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 700;
    font-family: var(--font-family);
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.2s;
}

.auth-banner-login-btn:hover {
    transform: scale(1.05);
}

.auth-banner-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.auth-banner-close:hover {
    color: white;
}

/* --- Conflict Modal --- */
.conflict-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
}

.conflict-icon {
    font-size: 28px;
}

.conflict-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.conflict-info strong {
    font-size: 15px;
    color: var(--text-primary);
}

.conflict-info span {
    font-size: 13px;
    color: var(--text-secondary);
}

.conflict-time {
    font-size: 12px !important;
    color: var(--text-secondary) !important;
}

.auth-conflict-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-conflict-btn.local-btn {
    background: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.auth-conflict-btn.local-btn:hover {
    background: #e9ecef;
}

.auth-conflict-btn.cloud-btn {
    background: #0d6efd;
    color: white;
}

.auth-conflict-btn.cloud-btn:hover {
    background: #0b5ed7;
}

/* --- Mobile Adjustments --- */
@media (max-width: 768px) {
    .auth-banner {
        bottom: calc(var(--bottom-nav-height) + 16px);
        left: 12px;
        right: 12px;
        transform: none;
        border-radius: 14px;
        flex-wrap: wrap;
        justify-content: center;
        white-space: normal;
        text-align: center;
        gap: 10px;
        padding: 14px 18px;
    }

    @keyframes bannerSlideUp {
        from { transform: translateY(100px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }

    .auth-profile-menu {
        left: 12px;
        right: 12px;
        top: auto !important;
        bottom: calc(var(--bottom-nav-height) + 12px);
        border-radius: 14px;
    }

    .auth-btn-text {
        display: none !important;
    }
}
/* ============================================= */
/* ===== Settings — Adjustments (Plus/Minus)      */
/* ============================================= */

.settings-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.settings-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 14px 0;
}

.adj-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
    transition: border-color 0.2s;
}

.adj-field-row:hover {
    border-color: var(--primary-color);
}

.adj-total-row {
    margin-top: 16px;
    background: var(--header-bg);
    border-width: 2px;
}

.adj-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.adj-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.adj-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.adj-diff {
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
}

.adj-diff.adj-plus {
    color: var(--primary-color);
}

.adj-diff.adj-minus {
    color: var(--danger-color);
}

.adj-controls {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    margin-right: 16px;
}

.adj-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: var(--font-family);
    line-height: 1;
    user-select: none;
}

.adj-minus-btn {
    border-radius: 8px 0 0 8px;
    border-left: none;
}

.adj-plus-btn {
    border-radius: 0 8px 8px 0;
    border-right: none;
}

.adj-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.adj-btn:active {
    transform: scale(0.93);
}

.adj-value {
    min-width: 50px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    background: white;
    border: 1px solid var(--border-color);
    border-left: none;
    border-right: none;
    user-select: none;
}

.settings-major-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.settings-major-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-change-major-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.settings-change-major-btn:hover {
    background: #0b5ed7;
}

.settings-auth-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.settings-auth-email {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-auth-status {
    font-size: 13px;
    color: var(--progress-done-bg);
    font-weight: 600;
}

.settings-auth-actions {
    display: flex;
    gap: 10px;
}

.settings-action-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}

.settings-action-btn:hover {
    background: #e9ecef;
}

.settings-action-btn.danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
    background: transparent;
}

.settings-action-btn.danger:hover {
    background: #fef2f2;
}

/* Hide delete text on desktop */
.delete-btn-text {
    display: none;
}
/* =============================================
   PIN Input Styles
   ============================================= */

.pin-input-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    direction: ltr;
    margin: 0 auto;
}

.pin-digit {
    width: 56px;
    height: 64px;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    caret-color: var(--accent-primary);
}

.pin-digit:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.pin-digit::selection {
    background: transparent;
}

.pin-submit-btn {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: var(--accent-primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.pin-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pin-submit-btn:not(:disabled):hover {
    opacity: 0.9;
}

.pin-forgot-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.pin-forgot-btn:hover {
    color: var(--text-primary);
}

.pin-error {
    font-size: 14px;
    color: #dc3545;
    margin: 12px 0 0;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}
