/* ==========================================
   AUTH PAGES - Sign Up, Sign In, Profile
   ========================================== */

/* Auth Page Layout */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--off-white);
}

.auth-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

/* Auth Card */
.auth-card {
    width: 100%;
    max-width: 560px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 48px;
}

.auth-card-wide {
    max-width: 640px;
}

.auth-card-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 32px;
}

/* Form Elements */
.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.auth-form-group {
    margin-bottom: 20px;
}

.auth-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.auth-form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 15px;
    color: var(--text-dark);
    font-family: var(--font-family);
    transition: var(--transition);
    background: var(--white);
}

.auth-form-input::placeholder {
    color: var(--text-light);
}

.auth-form-input:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.auth-form-input.error {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Password Input Wrapper */
.password-wrapper {
    position: relative;
}

.password-wrapper .auth-form-input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: var(--transition);
}

.password-toggle:hover {
    color: var(--primary-purple);
}

/* Checkbox */
.auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 24px;
}

.auth-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-purple);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.auth-checkbox label {
    font-size: 13px;
    color: var(--text-gray);
    line-height: 1.5;
    cursor: pointer;
}

.auth-checkbox a {
    color: var(--primary-purple);
    font-weight: 500;
}

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

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--primary-purple);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 24px;
}

.auth-submit-btn:hover {
    background: var(--secondary-purple);
}

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

/* Forgot Password */
.forgot-link {
    display: block;
    text-align: right;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 28px;
    margin-top: -12px;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--primary-purple);
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    padding: 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Social Buttons */
.auth-social-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 32px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    font-family: var(--font-family);
    width: 100%;
    max-width: 320px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.social-btn:hover {
    border-color: var(--primary-purple);
    background: var(--lighter-purple);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.12);
    transform: translateY(-1px);
}

.social-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.social-btn img,
.social-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* Auth Footer Link */
.auth-footer-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-gray);
}

.auth-footer-text a {
    color: var(--primary-purple);
    font-weight: 600;
}

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

/* Error / Success Messages */
.auth-message {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
}

.auth-message.error {
    display: block;
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.auth-message.success {
    display: block;
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

/* Field Error */
.field-error {
    font-size: 12px;
    color: #EF4444;
    margin-top: 4px;
    display: none;
}

.field-error.visible {
    display: block;
}

/* Minimal Auth Footer (sign in/up pages only) */
.auth-mini-footer {
    background: var(--light-purple);
    padding: 20px;
    text-align: center;
}

.auth-mini-footer p {
    font-size: 13px;
    color: var(--text-gray);
}


/* ==========================================
   PROFILE PAGE
   ========================================== */

.profile-content {
    padding: 48px 0 80px;
    background: var(--off-white);
}

.profile-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 32px;
    align-items: start;
}

/* Settings Sidebar */
.settings-sidebar {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 32px 24px;
}

.profile-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 24px;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-family);
    text-decoration: none;
}

.settings-nav-item:hover {
    background: var(--lighter-purple);
    color: var(--primary-purple);
}

.settings-nav-item.active {
    background: var(--primary-purple);
    color: var(--white);
}

.settings-nav-item svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* Profile Form */
.profile-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 40px;
}

.profile-card-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 32px;
}

.profile-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
}

.profile-form-group {
    margin-bottom: 0;
}

.profile-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.profile-form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 15px;
    color: var(--text-dark);
    font-family: var(--font-family);
    transition: var(--transition);
    background: var(--white);
}

.profile-form-input:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.profile-form-input:disabled {
    background: var(--off-white);
    color: var(--text-gray);
    cursor: not-allowed;
}

.profile-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.profile-save-btn {
    padding: 14px 40px;
    background: var(--primary-purple);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition);
}

.profile-save-btn:hover {
    background: var(--secondary-purple);
}

.profile-reset-btn {
    padding: 14px 32px;
    background: var(--white);
    color: var(--text-dark);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition);
}

.profile-reset-btn:hover {
    border-color: var(--primary-purple);
    color: var(--primary-purple);
}

/* ==========================================
   COMPLETED LABS PANEL
   ========================================== */

.completed-labs-loading {
    text-align: center;
    padding: 40px 0;
    color: var(--text-gray);
    font-size: 14px;
}

.completed-labs-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-gray);
}

.completed-labs-empty h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.completed-labs-empty p {
    font-size: 14px;
    max-width: 320px;
    margin: 0 auto;
    line-height: 1.5;
}

.completed-labs-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.completed-labs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.completed-lab-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.completed-lab-card:hover {
    border-color: var(--accent-purple);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.08);
    transform: translateY(-1px);
}

.completed-lab-thumb {
    width: 80px;
    height: 56px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

.completed-lab-info {
    flex: 1;
    min-width: 0;
}

.completed-lab-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.completed-lab-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.completed-lab-level {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.completed-lab-level.level-beginner {
    background: #ECFDF5;
    color: #059669;
}

.completed-lab-level.level-intermediate {
    background: #FFF7ED;
    color: #D97706;
}

.completed-lab-level.level-advanced {
    background: #FEF2F2;
    color: #DC2626;
}

.completed-lab-provider {
    font-size: 12px;
    color: var(--text-gray);
    font-weight: 500;
}

.completed-lab-date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--success-green);
    font-weight: 600;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .auth-card {
        padding: 32px 24px;
    }

    .auth-card-title {
        font-size: 22px;
    }

    .auth-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }

    .settings-sidebar {
        position: static;
    }

    .profile-card {
        padding: 24px;
    }

    .profile-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .profile-form-group {
        margin-bottom: 20px;
    }

    .profile-actions {
        flex-direction: column;
    }

    .completed-lab-thumb {
        width: 64px;
        height: 44px;
    }

    .completed-lab-title {
        font-size: 14px;
    }
}

/* Profile Credits Card */
.profile-credits-card {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1px solid #ddd6fe;
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 0;
}

.profile-credits-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.profile-credits-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-credits-icon {
    flex-shrink: 0;
}

.profile-credits-label {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 2px;
}

.profile-credits-count {
    font-size: 32px;
    font-weight: 800;
    color: #7c3aed;
    line-height: 1;
}

.profile-credits-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #7c3aed;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.profile-credits-link:hover {
    background: #6d28d9;
}

@media (max-width: 768px) {
    .profile-credits-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================
   CREDITS & PLANS PANEL
   ========================================== */

/* Balance Bar */
.credits-plans-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border: 1px solid #ddd6fe;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.cp-balance-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cp-balance-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cp-balance-count {
    font-size: 28px;
    font-weight: 800;
    color: #7c3aed;
    line-height: 1;
}

.cp-tier-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: #ede9fe;
    color: #7c3aed;
    white-space: nowrap;
}

/* Yearly Plan Banner */
.credits-plans-yearly {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 28px;
    color: #fff;
}

.credits-plans-yearly.active {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.cp-yearly-info {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.cp-yearly-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cp-yearly-icon-active {
    background: rgba(255, 255, 255, 0.2);
}

.cp-yearly-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.cp-yearly-desc {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.5;
}

.cp-yearly-price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 16px;
}

.cp-yearly-price {
    font-size: 36px;
    font-weight: 800;
}

.cp-yearly-period {
    font-size: 16px;
    opacity: 0.8;
}

.cp-yearly-paypal {
    max-width: 300px;
    min-height: 45px;
}

/* Credit Packs */
.cp-packs-heading {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
}

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

.credit-pack-card {
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    position: relative;
    background: var(--white);
    transition: var(--transition);
}

.credit-pack-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.08);
}

.credit-pack-card.popular {
    border-color: #7c3aed;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.12);
}

.credit-pack-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #7c3aed;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

.credit-pack-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.credit-pack-credits {
    font-size: 32px;
    font-weight: 800;
    color: #7c3aed;
    line-height: 1;
    margin-bottom: 4px;
}

.credit-pack-credits span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
}

.credit-pack-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.credit-pack-paypal {
    min-height: 45px;
}

.cp-paypal-placeholder {
    font-size: 13px;
    color: var(--text-gray);
    padding: 12px;
}

.cp-loading, .cp-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-gray);
    font-size: 14px;
    grid-column: 1 / -1;
}

.cp-error {
    color: #DC2626;
}

/* Success/Error Messages */
.cp-success-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

.cp-msg-success {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

.cp-msg-error {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.cp-msg-info {
    background: #EFF6FF;
    color: #2563EB;
    border: 1px solid #BFDBFE;
}

/* ==========================================
   PURCHASE HISTORY PANEL
   ========================================== */

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

.purchase-history-table thead th {
    text-align: left;
    font-weight: 600;
    color: var(--text-gray);
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.purchase-history-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

.purchase-history-table tbody tr:last-child td {
    border-bottom: none;
}

.purchase-type-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.purchase-type-badge.credits {
    background: #EDE9FE;
    color: #7C3AED;
}

.purchase-type-badge.yearly {
    background: #ECFDF5;
    color: #059669;
}

.credits-history-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 16px;
}

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

.credits-history-table thead th {
    text-align: left;
    font-weight: 600;
    color: var(--text-gray);
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #f9fafb;
}

.credits-history-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

.credits-history-table tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive — Credits & Plans */
@media (max-width: 768px) {
    .credits-plans-grid {
        grid-template-columns: 1fr;
    }

    .credits-plans-balance {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .cp-yearly-paypal {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .auth-content {
        padding: 32px 16px;
    }

    .auth-card {
        padding: 28px 20px;
    }
}
