/* ===================================
   MDREAM AUTH & ACCOUNT STYLES
   Dark Theme with Purple Accents
   =================================== */

/* Auth Section */
.auth-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: calc(80px + var(--space-xl)) var(--space-lg) var(--space-xl);
}

.auth-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.auth-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top center, rgba(168, 85, 247, 0.15) 0%, transparent 50%);
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}

.auth-orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-purple);
    top: -100px;
    right: -100px;
}

.auth-orb-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-fuchsia);
    bottom: -50px;
    left: -50px;
}

/* Auth Container */
.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

/* Auth Card */
.auth-card {
    background: var(--gradient-card);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-xl);
}

.auth-card.centered {
    text-align: center;
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-header h1,
.auth-header h2 {
    font-size: 1.75rem;
    margin-bottom: var(--space-sm);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* Trial Badge */
.trial-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(168, 85, 247, 0.1);
    border: 1px dashed rgba(168, 85, 247, 0.3);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-xl);
    font-size: 0.875rem;
    color: var(--accent-light);
}

.trial-icon {
    font-size: 1rem;
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.auth-form label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: all var(--transition-base);
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.auth-form input::placeholder {
    color: var(--text-muted);
}

/* Password Input */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--accent-purple);
}

/* Password Requirements */
.password-requirements {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-top: var(--space-xs);
}

.requirement {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8125rem;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.requirement.met {
    color: var(--success);
}

.requirement.met .req-icon {
    content: '✓';
}

.req-icon {
    font-size: 0.75rem;
}

/* Form Options */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(168, 85, 247, 0.4);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.checkbox-label input:checked + .checkbox-custom {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

.checkbox-label input:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.checkbox-label a {
    color: var(--accent-purple);
    text-decoration: underline;
}

/* Forgot Password Link */
.forgot-link {
    font-size: 0.875rem;
    color: var(--accent-purple);
    transition: color var(--transition-fast);
}

.forgot-link:hover {
    color: var(--accent-light);
}

/* Form Error */
.form-error {
    font-size: 0.8125rem;
    color: var(--error);
    min-height: 0;
    transition: all var(--transition-fast);
}

.form-error:not(:empty) {
    margin-top: var(--space-xs);
}

/* Form Message */
.form-message {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    text-align: center;
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.form-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

/* Button Loading */
.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-xl) 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(168, 85, 247, 0.2);
}

.auth-divider span {
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Social Login */
.social-login {
    display: flex;
    gap: var(--space-md);
}

.btn-social {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-social:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-google:hover {
    border-color: rgba(66, 133, 244, 0.5);
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: var(--space-xl);
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--accent-purple);
    font-weight: 500;
}

.auth-footer a:hover {
    color: var(--accent-light);
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-lg);
}

.auth-modal-content {
    background: var(--gradient-card);
    border: 1px solid rgba(168, 85, 247, 0.15);
    border-radius: var(--radius-2xl);
    padding: var(--space-2xl);
    max-width: 400px;
    width: 100%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-xs);
    line-height: 1;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Footer Minimal */
.footer-minimal {
    background: transparent;
    padding: var(--space-xl) 0;
}

.footer-minimal .footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-links-inline {
    display: flex;
    gap: var(--space-lg);
}

.footer-links-inline a {
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.footer-links-inline a:hover {
    color: var(--accent-purple);
}

/* ===================================
   ACCOUNT DASHBOARD STYLES
   =================================== */

.account-section {
    min-height: 100vh;
    position: relative;
    padding: calc(80px + var(--space-2xl)) 0 var(--space-4xl);
}

/* Loading State */
.account-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    gap: var(--space-lg);
    color: var(--text-secondary);
}

.spinner-large {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(168, 85, 247, 0.2);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Auth Required */
.account-auth-required {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.mt-md {
    margin-top: var(--space-md);
}

/* Account Dashboard */
.account-dashboard {
    position: relative;
    z-index: 1;
}

/* Account Header */
.account-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
}

.account-user {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info h1 {
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
}

.user-info p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
}

/* Dashboard Card */
.dashboard-card {
    background: var(--gradient-card);
    border: 1px solid rgba(168, 85, 247, 0.1);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
}

.dashboard-card:hover {
    border-color: rgba(168, 85, 247, 0.25);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid rgba(168, 85, 247, 0.1);
}

.card-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-md) var(--space-lg);
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(168, 85, 247, 0.05);
}

.card-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

/* Status Badge */
.status-badge {
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.status-badge.trial {
    background: rgba(234, 179, 8, 0.1);
    color: var(--warning);
}

.status-badge.inactive {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Subscription Card */
.plan-info {
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.plan-name {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.plan-price {
    color: var(--text-secondary);
    font-size: 1rem;
}

.plan-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9375rem;
}

.detail-row span:first-child {
    color: var(--text-muted);
}

/* Trial State */
.trial-state {
    padding: var(--space-lg);
    background: rgba(234, 179, 8, 0.05);
    border-top: 1px solid rgba(234, 179, 8, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.trial-progress {
    flex: 1;
}

.trial-bar {
    height: 6px;
    background: rgba(234, 179, 8, 0.2);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.trial-fill {
    height: 100%;
    background: var(--warning);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.trial-text {
    font-size: 0.8125rem;
    color: var(--warning);
}

/* No Subscription */
.no-subscription {
    text-align: center;
    padding: var(--space-xl);
}

.no-subscription p {
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

/* Downloads Card */
.download-item {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    transition: background var(--transition-fast);
}

.download-item:hover {
    background: rgba(168, 85, 247, 0.05);
}

.download-item + .download-item {
    border-top: 1px solid rgba(168, 85, 247, 0.05);
}

.download-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 85, 247, 0.1);
    border-radius: var(--radius-lg);
    color: var(--accent-purple);
}

.download-info {
    flex: 1;
}

.download-info h3 {
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

.download-info p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.help-text {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.help-text a {
    color: var(--accent-purple);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: rgba(168, 85, 247, 0.05);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    color: var(--text-primary);
}

.action-item:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.2);
}

.action-icon {
    font-size: 1.5rem;
}

.action-label {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

/* Billing Table */
.billing-table-wrapper {
    overflow-x: auto;
}

.billing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.billing-table th,
.billing-table td {
    padding: var(--space-md);
    text-align: left;
}

.billing-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(168, 85, 247, 0.1);
}

.billing-table td {
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(168, 85, 247, 0.05);
}

.billing-table tr:last-child td {
    border-bottom: none;
}

.billing-table .empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: var(--space-xl);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: var(--accent-purple);
}

.btn-outline:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: var(--accent-purple);
}

.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .auth-card {
        padding: var(--space-xl);
    }

    .account-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .trial-state {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .auth-section {
        padding-left: var(--space-md);
        padding-right: var(--space-md);
    }

    .auth-card {
        padding: var(--space-lg);
    }

    .footer-minimal .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ===================================
   TRIAL INTEGRATION STYLES
   =================================== */

/* Trial Required State - Prompt to start trial */
.trial-required-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-xl);
}

.trial-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.trial-prompt-icon {
    font-size: 3rem;
    margin-bottom: var(--space-sm);
}

.trial-prompt h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

.trial-prompt p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    max-width: 320px;
    line-height: 1.6;
}

.trial-prompt .btn {
    margin-top: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.trial-note {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

/* Download Available State */
.download-available-state .download-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(168, 85, 247, 0.05);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.download-available-state .download-item:last-child {
    margin-bottom: 0;
}

.download-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(168, 85, 247, 0.1);
    border-radius: var(--radius-md);
    color: var(--accent-purple);
}

.download-info {
    flex: 1;
}

.download-info h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs);
}

.download-info p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
}

/* Trial Success Toast */
.trial-success-toast {
    position: fixed;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Loading state for trial button */
#startTrialBtn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

#startTrialBtn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Trial banner for dashboard header */
.trial-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(251, 191, 36, 0.05));
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
}

.trial-banner-text {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.trial-banner-text span:first-child {
    font-size: 1.25rem;
}

.trial-banner-text strong {
    color: var(--text-primary);
}

.trial-banner .btn {
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 640px) {
    .trial-success-toast {
        left: var(--space-md);
        right: var(--space-md);
        transform: none;
        bottom: var(--space-md);
    }
    
    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .trial-banner {
        flex-direction: column;
        text-align: center;
    }
}

