/**
 * Allgot Membership Styles
 * Professionell, seriös design med dämpade färger
 */

:root {
    --allgot-primary: #2c5282;
    --allgot-primary-hover: #234166;
    --allgot-secondary: #4a5568;
    --allgot-success: #2f855a;
    --allgot-error: #c53030;
    --allgot-text: #2d3748;
    --allgot-text-light: #718096;
    --allgot-border: #e2e8f0;
    --allgot-bg: #ffffff;
    --allgot-bg-light: #f7fafc;
    --allgot-shadow: rgba(0, 0, 0, 0.1);
    --allgot-radius: 8px;
}

/* Container */
.allgot-membership-container {
    max-width: 520px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
}

.allgot-member-card {
    background: var(--allgot-bg);
    border: 1px solid var(--allgot-border);
    border-radius: calc(var(--allgot-radius) * 1.5);
    padding: 40px;
    box-shadow: 0 20px 50px rgba(44, 82, 130, 0.15);
    text-align: center;
}

.allgot-member-card h3 {
    margin-top: 0;
    font-size: 26px;
}

.allgot-member-card p {
    color: var(--allgot-text-light);
    margin-bottom: 24px;
}

.allgot-member-meta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--allgot-text-light);
}

.allgot-member-date {
    font-size: 13px;
}

.allgot-member-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(47, 133, 90, 0.1);
    color: var(--allgot-success);
    font-weight: 600;
}

.allgot-member-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

/* Progress Indicator */
.allgot-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 0 20px;
}

.allgot-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
}

.allgot-progress-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--allgot-bg-light);
    border: 2px solid var(--allgot-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--allgot-text-light);
    transition: all 0.3s ease;
}

.allgot-progress-step.active .allgot-progress-circle {
    background: var(--allgot-primary);
    border-color: var(--allgot-primary);
    color: white;
}

.allgot-progress-step.completed .allgot-progress-circle {
    background: var(--allgot-success);
    border-color: var(--allgot-success);
    color: white;
}

.allgot-progress-label {
    margin-top: 8px;
    font-size: 12px;
    color: var(--allgot-text-light);
    font-weight: 500;
}

.allgot-progress-step.active .allgot-progress-label {
    color: var(--allgot-primary);
}

.allgot-progress-line {
    flex: 1;
    height: 2px;
    background: var(--allgot-border);
    margin: 0 8px;
    margin-bottom: 26px;
}

.allgot-progress-step.active ~ .allgot-progress-line {
    background: var(--allgot-border);
}

.allgot-progress-step.completed + .allgot-progress-line {
    background: linear-gradient(90deg, var(--allgot-primary), var(--allgot-success));
}

/* Steps */
.allgot-step {
    display: none;
    background: var(--allgot-bg);
    border: 1px solid var(--allgot-border);
    border-radius: var(--allgot-radius);
    padding: 32px;
}

.allgot-step.active {
    display: block;
}

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

.allgot-step-content h2,
.allgot-step-content h3 {
    margin: 0 0 6px;
    color: var(--allgot-text);
    font-size: 20px;
    font-weight: 600;
}

.allgot-subtitle {
    color: var(--allgot-text-light);
    margin: 0 0 20px;
    font-size: 14px;
}

/* Form Elements */
.allgot-form-group {
    margin-bottom: 20px;
}

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

.allgot-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--allgot-border);
    border-radius: var(--allgot-radius);
    font-size: 15px;
    color: var(--allgot-text);
    background: var(--allgot-bg);
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

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

.allgot-help-text {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--allgot-text-light);
}

.allgot-form-error {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: var(--allgot-radius);
    color: var(--allgot-error);
    font-size: 14px;
}

.allgot-auth-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--allgot-text-light);
    margin: 16px 0;
}

.allgot-auth-links-inline {
    justify-content: center;
}

.allgot-link {
    color: var(--allgot-primary);
    text-decoration: none;
    font-weight: 500;
}

.allgot-link:hover {
    text-decoration: underline;
}

/* Buttons */
.allgot-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--allgot-radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.allgot-btn-primary {
    background: var(--allgot-primary);
    color: white;
}

.allgot-btn-primary:hover {
    background: var(--allgot-primary-hover);
}

.allgot-btn-secondary {
    background: transparent;
    color: var(--allgot-text);
    border: 1px solid var(--allgot-border);
}

.allgot-btn-secondary:hover {
    background: var(--allgot-bg-light);
}

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

.allgot-btn-outline:hover {
    background: var(--allgot-primary);
    color: white;
}

.allgot-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.allgot-btn svg {
    width: 18px;
    height: 18px;
}

/* Step Actions */
.allgot-step-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.allgot-step-actions .allgot-btn {
    flex: 1;
}

/* Plans - Clean 2x2 Grid Layout */
.allgot-plans {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 24px 0;
}

.allgot-plan {
    position: relative;
    padding: 28px 20px;
    border: 1px solid var(--allgot-border);
    border-radius: var(--allgot-radius);
    text-align: center;
    cursor: pointer;
    background: var(--allgot-bg);
    transition: all 0.2s ease;
}

.allgot-plan:hover {
    border-color: var(--allgot-primary);
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.1);
}

.allgot-plan.selected {
    border-color: var(--allgot-primary);
    border-width: 2px;
    background: var(--allgot-bg);
    box-shadow: 0 4px 16px rgba(44, 82, 130, 0.15);
}

/* Best value highlight - subtle top accent */
.allgot-plan.allgot-plan-featured {
    border-color: var(--allgot-primary);
}

.allgot-plan.allgot-plan-featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--allgot-primary);
    border-radius: var(--allgot-radius) var(--allgot-radius) 0 0;
}

.allgot-plan-badge {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--allgot-primary);
    color: white;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Trial badge - subtle and understated */
.allgot-plan-trial {
    display: block;
    color: var(--allgot-text-light);
    padding: 0;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 12px;
    background: none;
    border: none;
}

.allgot-plan.selected .allgot-plan-trial {
    color: var(--allgot-primary);
}

/* Plan name - secondary */
.allgot-plan h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--allgot-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Price - primary visual element */
.allgot-plan-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--allgot-text);
    margin-bottom: 4px;
    line-height: 1.2;
}

.allgot-plan.selected .allgot-plan-price {
    color: var(--allgot-primary);
}

.allgot-plan-duration {
    font-size: 13px;
    color: var(--allgot-text-light);
    margin-bottom: 4px;
}

.allgot-plan .allgot-btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
}

.allgot-plan.selected .allgot-btn-outline {
    background: var(--allgot-primary);
    color: white;
    border-color: var(--allgot-primary);
}

/* Payment Summary */
.allgot-payment-summary {
    background: var(--allgot-bg-light);
    border-radius: var(--allgot-radius);
    padding: 20px;
    margin-bottom: 24px;
}

.allgot-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.allgot-summary-row span {
    color: var(--allgot-text-light);
}

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

.allgot-summary-divider {
    height: 1px;
    background: var(--allgot-border);
    margin: 12px 0;
}

.allgot-summary-total {
    font-size: 16px;
    padding-top: 12px;
}

.allgot-summary-total strong {
    color: var(--allgot-primary);
    font-size: 18px;
}

/* Success Content */
.allgot-success-content {
    text-align: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

.allgot-success-icon {
    margin: 0 auto 24px;
    color: var(--allgot-success);
    transition: transform 0.4s ease;
}

.allgot-success-icon.is-playing svg {
    animation: successPop 0.6s ease forwards;
}

.allgot-success-content h3 {
    color: var(--allgot-text);
    margin-bottom: 12px;
}

.allgot-success-content p {
    color: var(--allgot-text-light);
    margin-bottom: 24px;
    font-size: 15px;
}

.allgot-success-celebration {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
}

.allgot-success-celebration span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 14px;
    border-radius: 2px;
    opacity: 0;
    transform: translate(-50%, -50%);
}

.allgot-success-celebration span:nth-child(3n+1) {
    background: var(--allgot-primary);
}

.allgot-success-celebration span:nth-child(3n+2) {
    background: var(--allgot-success);
}

.allgot-success-celebration span:nth-child(3n) {
    background: #f6ad55;
}

.allgot-success-celebration.is-playing,
.allgot-success-icon.is-playing {
    opacity: 1;
}

.allgot-success-celebration.is-playing span {
    animation: confettiDrift 1.2s ease forwards;
    animation-delay: calc(var(--i) * 40ms);
}

/* Loading Overlay */
.allgot-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--allgot-radius);
    z-index: 10;
}

.allgot-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--allgot-border);
    border-top-color: var(--allgot-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@keyframes confettiDrift {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.8) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + (var(--i) - 6) * 6px), 60px) scale(1.1) rotate(260deg);
    }
}

@keyframes successPop {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    60% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.allgot-loading-overlay p {
    margin-top: 16px;
    color: var(--allgot-text-light);
    font-size: 14px;
}

/* Inactive Member Styles */
.allgot-inactive-member-container {
    position: relative;
}

.allgot-inactive-header {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: var(--allgot-bg-light);
    border: 1px solid var(--allgot-border);
    border-radius: var(--allgot-radius);
}

.allgot-inactive-header h3 {
    margin: 0 0 6px;
    color: var(--allgot-text);
    font-size: 20px;
    font-weight: 600;
}

.allgot-inactive-notice {
    margin: 0;
    color: var(--allgot-text-light);
    font-size: 14px;
    line-height: 1.5;
}

.allgot-progress-inactive {
    margin-bottom: 24px;
}

/* Subscription Status Shortcode */
.allgot-subscription-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--allgot-bg);
    border: 1px solid var(--allgot-border);
    border-radius: var(--allgot-radius);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: var(--allgot-text);
}

.allgot-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.allgot-status-indicator.allgot-status-active {
    background: var(--allgot-success);
    box-shadow: 0 0 0 0 rgba(47, 133, 90, 0.4);
    animation: pulse-green 2s ease-in-out infinite;
}

.allgot-status-indicator.allgot-status-inactive {
    background: var(--allgot-error);
    box-shadow: 0 0 0 0 rgba(197, 48, 48, 0.4);
    animation: pulse-red 2s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(47, 133, 90, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(47, 133, 90, 0);
    }
}

@keyframes pulse-red {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(197, 48, 48, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(197, 48, 48, 0);
    }
}

.allgot-status-text {
    color: var(--allgot-text);
}

.allgot-status-text strong {
    font-weight: 600;
}

.allgot-status-link {
    color: var(--allgot-primary);
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
}

.allgot-status-link:hover {
    text-decoration: underline;
}

/* Compact variant */
.allgot-subscription-status.allgot-status-compact {
    padding: 6px 12px;
    font-size: 13px;
}

.allgot-subscription-status.allgot-status-compact .allgot-status-indicator {
    width: 8px;
    height: 8px;
}

/* Trial row in payment summary */
.allgot-trial-row strong {
    color: var(--allgot-success) !important;
    font-weight: 600;
}

/* State indicator for inactive member container */
.allgot-state-inactive-member .allgot-inactive-member-container {
    display: block;
}

/* Responsive */
@media (max-width: 640px) {
    .allgot-membership-container {
        padding: 20px 12px;
    }

    .allgot-member-card {
        padding: 24px 16px;
    }

    .allgot-step {
        padding: 20px 16px;
    }

    .allgot-progress {
        padding: 0 8px;
    }

    .allgot-progress-label {
        font-size: 10px;
    }

    .allgot-progress-circle {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    /* Keep 2x2 grid on mobile with smaller spacing */
    .allgot-plans {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .allgot-plan {
        padding: 16px 12px;
    }

    .allgot-plan h4 {
        font-size: 12px;
    }

    .allgot-plan-price {
        font-size: 22px;
    }

    .allgot-plan-duration {
        font-size: 11px;
        margin-bottom: 12px;
    }

    .allgot-plan-trial {
        font-size: 11px;
    }

    .allgot-plan .allgot-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .allgot-plan-badge {
        font-size: 9px;
        padding: 3px 10px;
    }

    .allgot-step-actions {
        flex-direction: column-reverse;
    }

    .allgot-step-actions .allgot-btn {
        width: 100%;
    }

    .allgot-inactive-header {
        padding: 16px;
    }

    .allgot-inactive-header h3 {
        font-size: 18px;
    }

    .allgot-inactive-notice {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .allgot-membership-container *,
    .allgot-membership-container *::before,
    .allgot-membership-container *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0s !important;
    }
}
