/* ─── Auth Pages Styles ──────────────────────────────────────────── */

/* Auth page layout — centered card */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 1.5rem 3rem;
    position: relative;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
}

/* Auth card */
.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 3rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: authCardIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes authCardIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Auth header */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header .auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.auth-header .auth-logo img {
    width: 36px;
    height: 36px;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Form groups */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.form-group .label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-group .label-row a {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.form-group .label-row a:hover {
    color: var(--accent);
}

/* Inputs */
.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    outline: none;
    transition: var(--transition);
    box-sizing: border-box;
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

/* Input with icon */
.input-wrapper {
    position: relative;
}

.input-wrapper .form-input {
    padding-left: 2.8rem;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
    pointer-events: none;
    transition: var(--transition);
}

.input-wrapper .form-input:focus ~ .input-icon,
.input-wrapper .form-input:focus + .input-icon {
    color: var(--primary);
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    transition: var(--transition);
}

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

/* Submit button */
.auth-btn {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

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

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading spinner for button */
.auth-btn .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}

.auth-btn.loading .btn-text {
    display: none;
}

.auth-btn.loading .spinner {
    display: block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

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

/* Auth footer links */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.auth-footer a:hover {
    color: var(--accent);
}

/* Alert messages */
.auth-alert {
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    display: none;
    animation: alertIn 0.3s ease both;
}

@keyframes alertIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-alert.show {
    display: block;
}

.auth-alert.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.auth-alert.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.auth-alert.info {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
}

/* ─── Account Dashboard Styles ───────────────────────────────────── */

.account-page {
    min-height: 100vh;
    padding: 7rem 1.5rem 3rem;
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(168, 85, 247, 0.07) 0%, transparent 50%);
}

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

.account-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.account-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: authCardIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.account-card h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.account-card h2 i {
    font-size: 1.3rem;
    color: var(--primary);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
}

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

.info-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.info-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.status-badge.trial {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
}

/* Download buttons grid */
.download-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.download-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.download-link i {
    font-size: 1.3rem;
    color: var(--primary);
}

.download-link:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    transform: translateX(4px);
}

/* Sign out button */
.signout-btn {
    width: 100%;
    padding: 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    color: #f87171;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.signout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, rgba(99, 102, 241, 0.08) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
    height: 1em;
    width: 120px;
    display: inline-block;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Invite code optional field styling */
.form-optional {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    opacity: 0.7;
}

/* Password strength meter */
.password-strength {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.password-strength .bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--border);
    transition: var(--transition);
}

.password-strength.weak .bar:nth-child(1) { background: #ef4444; }
.password-strength.medium .bar:nth-child(1),
.password-strength.medium .bar:nth-child(2) { background: #eab308; }
.password-strength.strong .bar:nth-child(1),
.password-strength.strong .bar:nth-child(2),
.password-strength.strong .bar:nth-child(3) { background: #22c55e; }
.password-strength.very-strong .bar { background: #22c55e; }

/* ─── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 1.25rem;
    }

    .auth-header h1 {
        font-size: 1.5rem;
    }

    .account-grid {
        grid-template-columns: 1fr;
    }

    .account-header h1 {
        font-size: 1.6rem;
    }
}
