/*
 * GrapphenMail Pricing Sync — Stylesheet
 * Version: 1.0.0
 *
 * Uses CSS custom properties from the theme:
 *   --color-primary, --color-secondary
 *   --color-gray-50 … --color-gray-900
 *   --color-white
 *
 * Fallback values are provided for standalone use.
 */

/* -------------------------------------------------------------------------
   Root fallbacks (only take effect when theme variables are absent)
   ---------------------------------------------------------------------- */
:root {
    --grapphenmail-primary:       var(--color-primary, #4f46e5);
    --grapphenmail-primary-dark:  var(--color-primary-dark, #3730a3);
    --grapphenmail-secondary:     var(--color-secondary, #06b6d4);
    --grapphenmail-white:         var(--color-white, #ffffff);
    --grapphenmail-gray-50:       var(--color-gray-50, #f9fafb);
    --grapphenmail-gray-100:      var(--color-gray-100, #f3f4f6);
    --grapphenmail-gray-200:      var(--color-gray-200, #e5e7eb);
    --grapphenmail-gray-400:      var(--color-gray-400, #9ca3af);
    --grapphenmail-gray-600:      var(--color-gray-600, #4b5563);
    --grapphenmail-gray-700:      var(--color-gray-700, #374151);
    --grapphenmail-gray-900:      var(--color-gray-900, #111827);
    --grapphenmail-yes-color:     #16a34a;
    --grapphenmail-no-color:      #dc2626;
    --grapphenmail-radius:        12px;
    --grapphenmail-radius-sm:     8px;
    --grapphenmail-shadow:        0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --grapphenmail-shadow-lg:     0 8px 32px rgba(79,70,229,.18);
    --grapphenmail-transition:    220ms cubic-bezier(.4,0,.2,1);
}

/* -------------------------------------------------------------------------
   Utility / Section wrapper
   ---------------------------------------------------------------------- */
.grapphenmail-pricing-section {
    width: 100%;
    padding: 0;
}

.grapphenmail-notice {
    color: var(--grapphenmail-gray-600);
    font-style: italic;
}

/* -------------------------------------------------------------------------
   Billing Toggle
   ---------------------------------------------------------------------- */
.grapphenmail-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 36px;
}

.grapphenmail-toggle-label {
    font-size: .9375rem;
    font-weight: 500;
    color: var(--grapphenmail-gray-600);
    transition: color var(--grapphenmail-transition);
    cursor: default;
}

.grapphenmail-toggle-label.is-active {
    color: var(--grapphenmail-gray-900);
    font-weight: 600;
}

.grapphenmail-toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 48px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: var(--grapphenmail-gray-200);
    cursor: pointer;
    transition: background var(--grapphenmail-transition);
    flex-shrink: 0;
}

.grapphenmail-toggle-switch:focus-visible {
    outline: 2px solid var(--grapphenmail-primary);
    outline-offset: 2px;
}

.grapphenmail-toggle-switch[aria-checked="true"] {
    background: var(--grapphenmail-primary);
}

.grapphenmail-toggle-thumb {
    position: absolute;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--grapphenmail-white);
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    transition: transform var(--grapphenmail-transition);
}

.grapphenmail-toggle-switch[aria-checked="true"] .grapphenmail-toggle-thumb {
    transform: translateX(22px);
}

.grapphenmail-toggle-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--grapphenmail-primary) 12%, transparent);
    color: var(--grapphenmail-primary);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
}

/* -------------------------------------------------------------------------
   Pricing Grid
   ---------------------------------------------------------------------- */
.grapphenmail-pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: stretch;
}

@media (max-width: 1024px) {
    .grapphenmail-pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .grapphenmail-pricing-grid {
        grid-template-columns: 1fr;
    }
}

/* -------------------------------------------------------------------------
   Pricing Card
   ---------------------------------------------------------------------- */
.grapphenmail-pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--grapphenmail-white);
    border: 1.5px solid var(--grapphenmail-gray-200);
    border-radius: var(--grapphenmail-radius);
    padding: 32px 28px;
    box-shadow: var(--grapphenmail-shadow);
    transition: transform var(--grapphenmail-transition), box-shadow var(--grapphenmail-transition);
}

.grapphenmail-pricing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,.1);
}

/* Featured / Highlighted card */
.grapphenmail-pricing-card.featured {
    border-color: transparent;
    background:
        linear-gradient(var(--grapphenmail-white), var(--grapphenmail-white)) padding-box,
        linear-gradient(135deg, var(--grapphenmail-primary), var(--grapphenmail-secondary)) border-box;
    border: 2px solid transparent;
    box-shadow: var(--grapphenmail-shadow-lg);
    z-index: 1;
}

.grapphenmail-pricing-card.featured:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(79,70,229,.22);
}

/* Badge */
.grapphenmail-card-badge {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 16px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--grapphenmail-primary), var(--grapphenmail-secondary));
    color: var(--grapphenmail-white);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Card header */
.grapphenmail-card-header {
    margin-bottom: 20px;
}

.grapphenmail-plan-name {
    margin: 0 0 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--grapphenmail-gray-900);
    line-height: 1.2;
}

.grapphenmail-plan-description {
    margin: 0;
    font-size: .875rem;
    color: var(--grapphenmail-gray-600);
    line-height: 1.5;
}

/* Price block */
.grapphenmail-card-price {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--grapphenmail-gray-100);
}

.grapphenmail-price-amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--grapphenmail-gray-900);
    line-height: 1;
    letter-spacing: -.02em;
}

.grapphenmail-price-custom {
    font-size: 2rem;
    font-weight: 700;
    color: var(--grapphenmail-gray-900);
}

.grapphenmail-price-period {
    font-size: .8125rem;
    color: var(--grapphenmail-gray-400);
    margin-left: 2px;
    vertical-align: bottom;
    line-height: 1.8;
}

.grapphenmail-price-annual-note {
    margin: 6px 0 0;
    min-height: 1.4em;
    font-size: .8125rem;
    color: var(--grapphenmail-primary);
    font-weight: 500;
}

/* Features list */
.grapphenmail-features-list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.grapphenmail-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .875rem;
    color: var(--grapphenmail-gray-700);
    line-height: 1.4;
}

.grapphenmail-feature-item.is-unavailable {
    opacity: .45;
    text-decoration: line-through;
    text-decoration-color: var(--grapphenmail-no-color);
}

.grapphenmail-feature-icon {
    flex-shrink: 0;
    width: 18px;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 700;
}

.grapphenmail-feature-item.is-available .grapphenmail-feature-icon {
    color: var(--grapphenmail-yes-color);
}

.grapphenmail-feature-item.is-unavailable .grapphenmail-feature-icon {
    color: var(--grapphenmail-no-color);
}

/* Card footer / CTA */
.grapphenmail-card-footer {
    margin-top: auto;
}

.grapphenmail-cta-button {
    display: block;
    width: 100%;
    padding: 13px 20px;
    border-radius: var(--grapphenmail-radius-sm);
    background: var(--grapphenmail-gray-100);
    color: var(--grapphenmail-gray-900);
    font-size: .9375rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background var(--grapphenmail-transition), color var(--grapphenmail-transition), transform var(--grapphenmail-transition);
    border: 1.5px solid var(--grapphenmail-gray-200);
    cursor: pointer;
}

.grapphenmail-cta-button:hover {
    background: var(--grapphenmail-gray-200);
    color: var(--grapphenmail-gray-900);
    transform: translateY(-1px);
    text-decoration: none;
}

.grapphenmail-cta-button--primary,
.grapphenmail-pricing-card.featured .grapphenmail-cta-button {
    background: linear-gradient(135deg, var(--grapphenmail-primary), var(--grapphenmail-secondary));
    color: var(--grapphenmail-white);
    border-color: transparent;
}

.grapphenmail-cta-button--primary:hover,
.grapphenmail-pricing-card.featured .grapphenmail-cta-button:hover {
    background: linear-gradient(135deg, var(--grapphenmail-primary-dark), var(--grapphenmail-primary));
    color: var(--grapphenmail-white);
    opacity: .95;
}

/* -------------------------------------------------------------------------
   Comparison Table
   ---------------------------------------------------------------------- */
.grapphenmail-comparison-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--grapphenmail-radius);
    box-shadow: var(--grapphenmail-shadow);
}

.grapphenmail-comparison-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    background: var(--grapphenmail-white);
    font-size: .875rem;
}

.grapphenmail-comparison-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.grapphenmail-comparison-table thead tr {
    background: var(--grapphenmail-gray-50);
    border-bottom: 2px solid var(--grapphenmail-gray-200);
}

.grapphenmail-comparison-table th,
.grapphenmail-comparison-table td {
    padding: 14px 20px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid var(--grapphenmail-gray-100);
    color: var(--grapphenmail-gray-700);
}

.grapphenmail-comparison-table th {
    font-weight: 700;
    font-size: .8125rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--grapphenmail-gray-900);
}

.grapphenmail-table-feature-col {
    text-align: left !important;
    min-width: 180px;
}

.grapphenmail-comparison-table tbody tr:hover {
    background: var(--grapphenmail-gray-50);
}

.grapphenmail-comparison-table tbody tr:last-child td,
.grapphenmail-comparison-table tbody tr:last-child th {
    border-bottom: none;
}

/* Feature value cells */
.grapphenmail-feature-yes {
    color: var(--grapphenmail-yes-color);
    font-size: 1.1rem;
    font-weight: 700;
}

.grapphenmail-feature-no {
    color: var(--grapphenmail-no-color);
    font-size: 1.1rem;
    font-weight: 700;
}

.grapphenmail-feature-na {
    color: var(--grapphenmail-gray-400);
}

/* -------------------------------------------------------------------------
   Responsive tweaks
   ---------------------------------------------------------------------- */
@media (max-width: 480px) {
    .grapphenmail-pricing-card {
        padding: 24px 18px;
    }

    .grapphenmail-price-amount {
        font-size: 2rem;
    }

    .grapphenmail-toggle {
        flex-wrap: wrap;
        gap: 8px;
    }
}
