/* ============================================
   Account Page Styles
   ============================================ */

.account-main {
    padding: 100px 0 60px;
    min-height: calc(100vh - 120px);
}

/* ---- Auth Section ---- */
.auth-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    max-width: 400px;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.auth-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-alt);
    color: var(--text);
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.auth-forgot {
    text-align: right;
    margin-top: 12px;
}

.auth-forgot a {
    font-size: 0.82rem;
    color: var(--primary);
    text-decoration: none;
}

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

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-switch-link {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
}

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

/* ---- Profile Section ---- */
.profile-section {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.profile-id {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 2px;
}

.profile-header .btn {
    margin-left: auto;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.82rem;
}

/* ---- Profile Cards ---- */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid var(--border-light);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.plan-badge {
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--primary-bg);
    color: var(--primary);
}

.plan-badge.pro {
    background: #dbeafe;
    color: #2563eb;
}

.plan-badge.ultimate {
    background: #d1fae5;
    color: #059669;
}

.plan-details {
    padding: 20px 28px;
}

.plan-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.plan-row:last-child {
    border-bottom: none;
}

.plan-row span {
    color: var(--text-secondary);
}

.plan-row strong {
    color: var(--text);
}

.status-active {
    color: #059669 !important;
}

.status-expired {
    color: #dc2626 !important;
}

.features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.feature-tag {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 500;
}

.feature-tag.on {
    background: #d1fae5;
    color: #059669;
}

.feature-tag.off {
    background: #f3f4f6;
    color: #9ca3af;
    text-decoration: line-through;
}

.card-actions {
    padding: 16px 28px;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
}

.btn-danger-text {
    color: #dc2626 !important;
}

.btn-danger-text:hover {
    border-color: #dc2626 !important;
    background: #fef2f2 !important;
}

/* ---- Token Usage ---- */
.usage-bar-container {
    padding: 24px 28px 16px;
}

.usage-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.usage-bar {
    height: 12px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--primary);
    transition: width 0.5s ease;
}

.usage-fill.warning {
    background: #f59e0b;
}

.usage-fill.danger {
    background: #dc2626;
}

.usage-remaining {
    text-align: right;
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 6px;
}

.usage-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 28px 20px;
}

.usage-stat {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 14px 16px;
    text-align: center;
}

.usage-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    margin-bottom: 4px;
}

.usage-stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* ---- Modal ---- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    padding: 32px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}

.upgrade-plans {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.upgrade-option {
    padding: 24px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.upgrade-option.featured {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.1);
}

.upgrade-option h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.upgrade-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 12px;
}

.upgrade-option ul {
    list-style: none;
    text-align: left;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.upgrade-option li {
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
}

.upgrade-option li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

.modal-note {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    font-style: italic;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .profile-header {
        flex-wrap: wrap;
    }
    .profile-header .btn {
        margin-left: 0;
        width: 100%;
    }
    .usage-breakdown {
        grid-template-columns: 1fr;
    }
    .upgrade-plans {
        grid-template-columns: 1fr;
    }
    .card-actions {
        flex-direction: column;
    }
}
