/* Plan / Access Page Styles */

.plan-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: var(--ui-font);
}

.plan-header {
    text-align: center;
    margin-bottom: 40px;
}

.plan-logo {
    display: inline-block;
    font-family: CMSerif, Georgia, serif;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 0.3em;
    color: white;
    text-decoration: none;
    margin-bottom: 32px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.plan-logo:hover {
    opacity: 1;
}

.plan-header h1 {
    font-family: CMSerif, Georgia, serif;
    font-size: 1.8rem;
    font-weight: normal;
    color: white;
}

/* Global Features Block */
.plan-features-global {
    max-width: 480px;
    margin: 40px auto 48px;
}

.features-intro {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 16px;
}

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

.plan-features li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.plan-features li::before {
    content: '·';
    position: absolute;
    left: 4px;
    color: rgba(255, 255, 255, 0.5);
}

/* Plan Grid */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 780px;
    margin: 0 auto;
    align-items: stretch;
}

/* Plan Card */
.plan-card {
    background: rgba(34, 34, 34, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
    transition: opacity 0.05s ease;
}

.plan-card .plan-button {
    margin-top: auto;
}

.plan-card.primary {
    border-color: rgba(255, 255, 255, 0.12);
}

.plan-card.secondary,
.plan-card.tertiary {
    opacity: 0.9;
}

/* Plan Content */
.plan-name {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
}

.plan-price {
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: normal;
    color: white;
    line-height: 1;
}


.price-currency {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
}

.price-period {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
}

.plan-note {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 20px;
    min-height: 1.2em;
}

/* Plan Button */
.plan-button {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-family: var(--ui-font);
    font-size: 0.95rem;
    font-weight: var(--ui-font-weight-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--active-color);
    color: #000;
    box-shadow: 0px 4px 0px rgba(0, 0, 0, 0.2), 0 0 32px inset rgba(255, 255, 255, 0.05), 0 0 3px inset rgba(255, 255, 255, 0.1);
}

.plan-button:hover {
    background: rgb(166, 219, 20);
    transform: translateY(-2px);
    box-shadow: 0px 6px 0px rgba(0, 0, 0, 0.2), 0 0 32px inset rgba(255, 255, 255, 0.08), 0 0 3px inset rgba(255, 255, 255, 0.15);
}

.plan-button:active {
    transform: translateY(0);
    box-shadow: 0px 2px 0px rgba(0, 0, 0, 0.2), 0 0 32px inset rgba(255, 255, 255, 0.05), 0 0 3px inset rgba(255, 255, 255, 0.1);
}

.plan-button.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0px 4px 0px rgba(0, 0, 0, 0.2), 0 0 32px inset rgba(255, 255, 255, 0.05), 0 0 3px inset rgba(255, 255, 255, 0.1);
}

.plan-button.secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    box-shadow: 0px 6px 0px rgba(0, 0, 0, 0.2), 0 0 32px inset rgba(255, 255, 255, 0.08), 0 0 3px inset rgba(255, 255, 255, 0.15);
}

.plan-button.secondary:active {
    transform: translateY(0);
    box-shadow: 0px 2px 0px rgba(0, 0, 0, 0.2), 0 0 32px inset rgba(255, 255, 255, 0.05), 0 0 3px inset rgba(255, 255, 255, 0.1);
}

a.plan-button,
a.plan-button:hover {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* Loading state */
.plan-button .button-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Plan Footer */
.plan-footer {
    text-align: center;
}

.plan-refund {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 16px;
}

.plan-footer .back-link {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.plan-footer .back-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

.plan-footer .back-chevron {
    width: 16px;
    height: 16px;
    transform: translateY(1px);
}

/* Responsive */
@media (max-width: 800px) {
    .plan-grid {
        grid-template-columns: 1fr 1fr;
        max-width: 500px;
    }

    .plan-card.scholarship {
        grid-column: span 2;
        max-width: 240px;
        justify-self: center;
    }
}

@media (max-width: 550px) {
    .plan-grid {
        grid-template-columns: 1fr;
        max-width: 280px;
    }

    .plan-card.primary {
        order: -1;
    }

    .plan-card.scholarship {
        grid-column: span 1;
        max-width: none;
    }

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

@media (max-width: 500px) {
    .plan-container {
        padding: 40px 16px;
    }

    .plan-header {
        margin-bottom: 32px;
    }

    .plan-features-global {
        margin-top: 32px;
    }
}

/* Confirmation Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    transition: background 0.4s ease, backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease;
}

.modal-overlay.active {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-card {
    background: rgba(34, 34, 34, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 32px;
    width: min(420px, calc(100vw - 40px));
    position: relative;
    font-family: var(--ui-font);
    transform-origin: center center;
    box-sizing: border-box;
    overflow: hidden;
    /* Spring easing: overshoot then settle */
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
}

.modal-card.morphing {
    transition: none;
}

.modal-card .modal-content {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease 0.15s, transform 0.25s ease 0.15s;
}

.modal-overlay.active .modal-card .modal-content {
    opacity: 1;
    transform: translateY(0);
}

.modal-overlay.closing .modal-card .modal-content {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.modal-overlay.closing .modal-card {
    transition: transform 0.35s cubic-bezier(0.5, 0, 0.75, 0),
                opacity 0.35s ease;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease 0.2s, color 0.2s ease;
}

.modal-overlay.active .modal-close {
    opacity: 1;
}

.modal-overlay.closing .modal-close {
    opacity: 0;
    transition: opacity 0.1s ease;
}

.modal-close:hover {
    color: rgba(255, 255, 255, 0.8);
}

.modal-title {
    font-family: CMSerif, Georgia, serif;
    font-size: 1.4rem;
    font-weight: normal;
    color: white;
    margin: 0 0 24px 0;
    text-align: center;
}

.modal-plan-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.modal-plan-name {
    font-size: 0.95rem;
    color: white;
}

.modal-plan-price {
    font-size: 0.95rem;
    color: var(--active-color);
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.modal-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

.detail-value {
    font-size: 0.95rem;
    color: white;
}

.modal-cgv {
    margin-bottom: 24px;
}

.modal-cgv .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.modal-cgv input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    margin-top: 0;
    cursor: pointer;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    position: relative;
    transition: all 0.15s ease;
}

.modal-cgv input[type="checkbox"]:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
}

.modal-cgv input[type="checkbox"]:checked {
    background: var(--active-color);
    border-color: var(--active-color);
}

.modal-cgv input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 3px;
    width: 5px;
    height: 9px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.modal-cgv a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: underline;
}

.modal-cgv a:hover {
    color: white;
}

.modal-confirm-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-family: var(--ui-font);
    font-size: 1rem;
    font-weight: var(--ui-font-weight-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--active-color);
    color: #000;
    box-shadow: 0px 4px 0px rgba(0, 0, 0, 0.2), 0 0 32px inset rgba(255, 255, 255, 0.05), 0 0 3px inset rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-confirm-btn:hover {
    background: rgb(166, 219, 20);
    transform: translateY(-2px);
    box-shadow: 0px 6px 0px rgba(0, 0, 0, 0.2), 0 0 32px inset rgba(255, 255, 255, 0.08), 0 0 3px inset rgba(255, 255, 255, 0.15);
}

.modal-confirm-btn:active {
    transform: translateY(0);
    box-shadow: 0px 2px 0px rgba(0, 0, 0, 0.2), 0 0 32px inset rgba(255, 255, 255, 0.05), 0 0 3px inset rgba(255, 255, 255, 0.1);
}

.modal-confirm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

a.modal-confirm-btn,
a.modal-confirm-btn:hover {
    text-decoration: none;
}

.modal-confirm-btn .external-icon {
    width: 16px;
    height: 16px;
    margin-left: 6px;
    vertical-align: -2px;
}

.modal-confirm-btn .button-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Shake animation for unchecked CGV */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.modal-cgv .checkbox-label.shake {
    animation: shake 0.4s ease-in-out;
}

@media (max-width: 480px) {
    .modal-card {
        padding: 24px;
    }
}
