/* SnapPro — Micro-interactions, Dark theme */
:root {
    --bg: #0C0C0F;
    --surface: #16161A;
    --surface-elevated: #1C1C22;
    --text: #F4F4F5;
    --text-muted: #A1A1AA;
    --accent: #818CF8;
    --accent-hover: #A5B4FC;
    --accent-light: rgba(129, 140, 248, 0.15);
    --success: #34D399;
    --error: #F87171;
    --warning: #FBBF24;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Header */
.header {
    padding: 1.5rem 1.5rem;
    animation: fadeInDown 0.5s var(--ease-out) both;
}

.header-inner {
    max-width: 600px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: 16px;
    padding: 1.25rem 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    text-align: center;
    transition: box-shadow 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.header-inner:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transform: translateY(-1px);
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 0.25rem;
    transition: color 0.25s var(--ease-out), transform 0.25s var(--ease-bounce);
    animation: logoBounceIn 0.6s var(--ease-spring) both;
}

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

.logo:hover {
    color: var(--accent);
}

.logo:focus-visible {
    outline: none;
    border-radius: 8px;
    box-shadow: 0 0 0 2px var(--accent);
}

.logo:hover .logo-icon {
    transform: scale(1.15) rotate(-5deg);
}

.logo:active .logo-icon {
    transform: scale(0.95);
}

.logo-icon {
    font-size: 1.5rem;
    display: inline-block;
    transition: transform 0.25s var(--ease-bounce);
}

.tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    animation: fadeIn 0.5s var(--ease-out) 0.15s both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Main */
.main {
    max-width: 560px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* Hero (гость) */
.hero {
    padding: 0;
}

.hero-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    transition: box-shadow 0.3s var(--ease-out), transform 0.3s var(--ease-out);
    animation: cardScaleIn 0.5s var(--ease-out) 0.1s both;
}

@keyframes cardScaleIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.hero-title {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.hero-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* How it works */
.how-it-works {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem 0.5rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.25rem;
    background: var(--accent-light);
    border-radius: 16px;
    transition: box-shadow 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.how-it-works:hover {
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.2);
}

.step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    transition: transform 0.25s var(--ease-bounce);
}

.step:hover {
    transform: scale(1.05);
}

.step-num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: white;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    transition: transform 0.25s var(--ease-spring);
}

.step:hover .step-num {
    transform: scale(1.1) rotate(5deg);
}

.step-arrow {
    color: var(--text-muted);
    font-size: 1rem;
    transition: transform 0.3s var(--ease-out);
}

.step:hover + .step-arrow,
.step-arrow:hover {
    transform: translateX(4px);
}

/* Features */
.features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--surface);
    border-radius: 16px;
    min-width: 130px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    transition: all 0.3s var(--ease-out);
    cursor: default;
}

.feature:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.feature:active {
    transform: translateY(-2px);
    transition-duration: 0.1s;
}

.feature-icon {
    font-size: 1.75rem;
    display: inline-block;
    transition: transform 0.35s var(--ease-bounce);
}

.feature:hover .feature-icon {
    transform: scale(1.2);
}

.feature:nth-child(1):hover .feature-icon { transform: scale(1.2) rotate(-10deg); }
.feature:nth-child(2):hover .feature-icon { transform: scale(1.2) rotate(5deg); }
.feature:nth-child(3):hover .feature-icon { transform: scale(1.2) rotate(-5deg); }

.feature span:last-child {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    border: none;
    text-decoration: none;
}

.btn .btn-icon {
    transition: transform 0.3s var(--ease-bounce);
}

.btn:hover .btn-icon {
    transform: scale(1.15);
}

.btn:active .btn-icon {
    transform: scale(0.9);
}

.btn:active {
    transform: scale(0.98);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.05rem;
}

.btn-medium {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    min-width: 180px;
}

.btn-primary {
    background: var(--accent);
    color: #0C0C0F;
    box-shadow: 0 4px 14px rgba(129, 140, 248, 0.35);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(129, 140, 248, 0.45);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary:focus-visible,
.btn-accent:focus-visible,
.btn-outline:focus-visible,
.btn-ghost:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.4);
}

.btn-accent {
    background: var(--accent);
    color: #0C0C0F;
    box-shadow: 0 4px 14px rgba(129, 140, 248, 0.35);
}

.btn-accent:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text);
}

/* User section */
.user-section {
    padding: 0;
    animation: fadeInUp 0.5s var(--ease-out) both;
}

.user-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    transition: box-shadow 0.3s var(--ease-out);
}

.user-card:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.user-header {
    margin-bottom: 2rem;
}

.user-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-light), rgba(129, 140, 248, 0.25));
    border: 1px solid rgba(129, 140, 248, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    transition: transform 0.4s var(--ease-bounce);
}

.user-card:hover .user-avatar {
    transform: scale(1.05);
}

.avatar-icon {
    font-size: 2rem;
    transition: transform 0.3s var(--ease-bounce);
}

.user-avatar:hover .avatar-icon {
    transform: rotate(10deg);
}

.user-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.user-email {
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.subscription-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    transition: transform 0.25s var(--ease-out);
}

.subscription-status:hover {
    transform: scale(1.02);
}

.subscription-status.active {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
}

.subscription-status.inactive {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
}

.subscription-status.checking {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
}

.subscription-remaining {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.welcome-message {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.welcome-message.subscription-inactive {
    color: var(--error);
    font-weight: 500;
}

.user-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    align-items: center;
}

.user-card .features {
    margin-top: 0;
}

/* Footer */
.footer {
    padding: 1.5rem 1.5rem;
    margin: 0 1.5rem 2rem;
    text-align: center;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    animation: fadeInUp 0.5s var(--ease-out) 0.4s both;
    transition: box-shadow 0.3s var(--ease-out);
}

.footer:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.footer-inner {
    max-width: 640px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    position: relative;
    padding: 0.2rem 0;
    transition: color 0.25s var(--ease-out);
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s var(--ease-out);
}

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

.footer-links a:hover::after {
    width: 100%;
}

.footer-links .sep {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: modalBackdropIn 0.3s var(--ease-out) both;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalContentIn 0.35s var(--ease-spring) 0.05s both;
}

.payment-modal-content {
    background: var(--surface);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.08);
}

@keyframes modalBackdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalContentIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s var(--ease-out);
}

.modal-close:hover {
    background: rgba(248, 113, 113, 0.2);
    color: var(--error);
    transform: scale(1.05);
}

.modal-close:active {
    transform: scale(0.95);
}

.modal-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent);
}

.payment-header {
    margin-bottom: 1.5rem;
}

.payment-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.payment-body {
    padding-top: 0.5rem;
}

.start-date-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.start-date-row label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.start-date-row input[type="date"] {
    padding: 0.75rem;
    background: var(--surface-elevated);
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text);
    transition: all 0.25s var(--ease-out);
}

.start-date-row input[type="date"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.2);
}

.start-date-row input[type="date"]:focus-visible {
    outline: none;
}

.start-date-row input[type="date"]:hover {
    border-color: rgba(129, 140, 248, 0.4);
}

.subscription-plans {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.subscription-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--accent-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
    transition: opacity 0.2s var(--ease-out);
}

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

.subscription-loading p {
    animation: pulse 1.5s var(--ease-in-out) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Subscription plan cards */
.subscription-plan {
    background: var(--surface);
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: left;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: all 0.3s var(--ease-out);
}

.subscription-plan:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    border-color: rgba(129, 140, 248, 0.3);
}

.subscription-plan.featured {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.2);
}

.subscription-plan.featured:hover {
    box-shadow: 0 8px 32px rgba(129, 140, 248, 0.25);
}

.plan-badge {
    position: absolute;
    top: -10px;
    right: 1rem;
    background: var(--accent);
    color: #0C0C0F;
    padding: 0.25rem 0.75rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.plan-header {
    margin-bottom: 1rem;
}

.plan-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.plan-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
}

.plan-savings {
    font-size: 0.85rem;
    color: var(--success);
    margin-top: 0.25rem;
}

.plan-features {
    margin-bottom: 1rem;
}

.plan-features ul {
    list-style: none;
}

.plan-features li {
    padding: 0.35rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.plan-select-btn {
    width: 100%;
    padding: 0.75rem;
    font-weight: 600;
    background: var(--accent);
    color: #0C0C0F;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s var(--ease-out);
}

.plan-select-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(129, 140, 248, 0.4);
}

.plan-select-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.plan-select-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.plan-select-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.4);
}

/* Payment loader (PaymentService) */
.payment-loader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.payment-loader .loader-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text);
}

.payment-loader .loader-spinner {
    margin-bottom: 1rem;
}

/* Staggered animation for hero elements */
.hero-title {
    animation: fadeInUp 0.5s var(--ease-out) 0.1s both;
}

.hero-desc {
    animation: fadeInUp 0.5s var(--ease-out) 0.2s both;
}

.hero .btn {
    animation: fadeInUp 0.5s var(--ease-out) 0.3s both;
}

.how-it-works {
    animation: fadeInUp 0.5s var(--ease-out) 0.4s both;
}

.features .feature:nth-child(1) { animation: fadeInUp 0.5s var(--ease-out) 0.5s both; }
.features .feature:nth-child(2) { animation: fadeInUp 0.5s var(--ease-out) 0.6s both; }
.features .feature:nth-child(3) { animation: fadeInUp 0.5s var(--ease-out) 0.7s both; }

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

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

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Responsive */
@media (max-width: 640px) {
    .header-inner {
        padding: 1.25rem;
    }

    .hero-card {
        padding: 1.75rem 1.5rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-desc {
        font-size: 1rem;
    }

    .how-it-works {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .step-arrow {
        transform: rotate(90deg);
    }

    .features {
        flex-direction: column;
    }

    .feature {
        min-width: auto;
    }

    .user-card {
        padding: 1.75rem 1.5rem;
    }

    .footer {
        margin: 0 1rem 1.5rem;
    }

    .footer-links {
        flex-direction: column;
    }

    .footer-links .sep {
        display: none;
    }
}
