/*
 * OBP Stripe - Main Stylesheet
 * Shared styles for all pages
 * Colors sourced from OBP Portal theme (OKLCH color space)
 */

/* OBP Portal Color Variables */
:root {
    /* Primary Colors (dark teal/navy) */
    --color-primary-950: oklch(14.97% 0.03 285.58deg);
    --color-primary-900: oklch(17.29% 0.03 286.25deg);
    --color-primary-800: oklch(19.8% 0.03 283.79deg);
    --color-primary-700: oklch(21.93% 0.02 284.32deg);
    --color-primary-600: oklch(24.33% 0.02 280.66deg);
    --color-primary-500: oklch(26.42% 0.02 280.83deg);
    --color-primary-400: oklch(43.36% 0.01 280.75deg);
    --color-primary-300: oklch(58.74% 0.01 278.59deg);
    --color-primary-200: oklch(72.99% 0.01 286.35deg);
    --color-primary-100: oklch(86.74% 0 286.74deg);
    --color-primary-50: oklch(100% 0 none);

    /* Secondary Colors (teal/green) */
    --color-secondary-950: oklch(12.18% 0.01 144.78deg);
    --color-secondary-900: oklch(25.75% 0.04 148.91deg);
    --color-secondary-800: oklch(37.48% 0.07 148.84deg);
    --color-secondary-700: oklch(48.34% 0.09 148.26deg);
    --color-secondary-600: oklch(58.64% 0.12 148.32deg);
    --color-secondary-500: oklch(68.5% 0.14 148.36deg);
    --color-secondary-400: oklch(74.3% 0.11 149.35deg);
    --color-secondary-300: oklch(80.08% 0.08 150.72deg);
    --color-secondary-200: oklch(86.27% 0.06 150.59deg);
    --color-secondary-100: oklch(92.28% 0.03 152.28deg);
    --color-secondary-50: oklch(98.51% 0 none);

    /* Success Colors */
    --color-success-500: oklch(67.59% 0.23 142.31deg);
    --color-success-600: oklch(60.08% 0.2 142.28deg);
    --color-success-700: oklch(52.03% 0.18 142.25deg);

    /* Warning Colors */
    --color-warning-500: oklch(67.18% 0.17 50.54deg);
    --color-warning-600: oklch(58.59% 0.15 49.42deg);

    /* Error Colors */
    --color-error-500: oklch(63.44% 0.22 28.81deg);
    --color-error-600: oklch(56.26% 0.2 28.8deg);
    --color-error-700: oklch(48.85% 0.17 28.53deg);

    /* Surface Colors */
    --color-surface-50: oklch(100% 0 none);
    --color-surface-100: oklch(92.49% 0 none);
    --color-surface-200: oklch(84.52% 0 none);
    --color-surface-300: oklch(76.68% 0 none);
    --color-surface-900: oklch(21.78% 0 none);
    --color-surface-950: oklch(0% 0 none);

    /* Typography */
    --font-family-base:
        "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-mono: "Monaco", "Courier New", monospace;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-base);
    background: conic-gradient(
        from 180deg at 50% 50%,
        var(--color-primary-950) 0deg,
        var(--color-secondary-500) 120deg,
        var(--color-primary-950) 240deg,
        var(--color-secondary-500) 360deg
    );
    color: var(--color-surface-950);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(40px);
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

/* Container styles */
.sr-root {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.container,
.sr-main {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Header and logo */
.sr-header {
    text-align: center;
    margin-bottom: 40px;
}

.sr-header__logo {
    text-align: center;
    margin-bottom: 30px;
}

.sr-header__logo img {
    max-width: 300px;
    height: auto;
}

/* Typography */
h1 {
    color: var(--color-primary-950);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
    text-align: center;
}

h2 {
    color: var(--color-primary-800);
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-surface-200);
}

h3 {
    color: var(--color-primary-800);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
}

h4 {
    color: var(--color-primary-700);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.heading-dark {
    color: var(--color-primary-950);
}

.subtitle {
    color: var(--color-surface-900);
    font-size: 1.1rem;
    margin-bottom: 30px;
    opacity: 0.8;
}

/* User display */
.username-display {
    color: var(--color-primary-950);
    background: var(--color-secondary-50);
    padding: 8px 16px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Links */
a {
    color: var(--color-secondary-500);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

a:hover {
    text-decoration: underline;
    color: var(--color-secondary-700);
}

/* Buttons */
button,
.btn {
    background: var(--color-secondary-500);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
    min-width: 100px;
}

button:hover,
.btn:hover {
    background: var(--color-secondary-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px
        color-mix(in srgb, var(--color-secondary-500) 30%, transparent);
    text-decoration: none;
    color: white;
}

button:active,
.btn:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login {
    width: auto;
    min-width: 100px;
}

.manage-subscription {
    width: 100%;
    max-width: 300px;
    margin: 20px auto;
    display: block;
}

/* Button variations */
.btn-danger {
    background: var(--color-error-500);
}

.btn-danger:hover {
    background: var(--color-error-700);
    box-shadow: 0 4px 12px
        color-mix(in srgb, var(--color-error-500) 30%, transparent);
}

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

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

/* Subscription containers */
.subscribed {
    background: rgba(255, 255, 255, 0.95);
    margin-top: 30px;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.subscription-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    margin-top: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Pricing cards */
.price-table-container {
    display: flex;
    gap: 20px;
    margin: 40px 0;
    justify-content: center;
    flex-wrap: wrap;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
}

.price-table-container section {
    background: white;
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 280px;
    flex: 1;
    border-right: 1px solid var(--color-surface-200);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.price-table-container section:last-child {
    border-right: none;
}

.price-table-container section:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.price-table-container img {
    margin-bottom: 20px;
}

.price-table-container .name {
    color: var(--color-surface-900);
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 8px;
    margin-bottom: 16px;
    text-align: center;
}

.price-table-container .price {
    color: var(--color-primary-950);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.price-table-container .duration {
    color: var(--color-surface-900);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 24px;
    opacity: 0.7;
}

.price-table-container button {
    background: var(--color-surface-200);
    color: var(--color-surface-950);
    border-radius: 64px;
    padding: 12px 32px;
    width: 100%;
    font-weight: 600;
    transition: all 0.2s;
}

.price-table-container button:hover {
    background: var(--color-secondary-500);
    color: white;
    transform: translateY(-2px);
}

/* Attribute panel */
.attribute-panel {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--color-surface-200);
    border-radius: 12px;
    padding: 30px;
    margin: 40px auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.attribute-panel h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.3rem;
    color: var(--color-primary-950);
    border-bottom: 2px solid var(--color-secondary-500);
    padding-bottom: 10px;
}

.attribute-panel h4 {
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--color-primary-800);
    border-bottom: 1px solid var(--color-surface-200);
    padding-bottom: 8px;
}

.attribute-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.attribute-item {
    margin-bottom: 0;
}

.attribute-label {
    font-weight: 600;
    color: var(--color-primary-700);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.attribute-value {
    color: var(--color-surface-950);
    font-size: 0.95rem;
    word-break: break-all;
    font-family: var(--font-family-mono);
    background: var(--color-surface-100);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--color-surface-200);
}

/* Entitlements */
.entitlements-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.entitlements-list li {
    color: var(--color-surface-950);
    font-size: 0.9rem;
    padding: 12px 16px;
    background: var(--color-surface-100);
    border-radius: 6px;
    border: 1px solid var(--color-surface-200);
    font-weight: 500;
    transition: all 0.2s;
}

.entitlements-list li:hover {
    background: var(--color-secondary-50);
    border-color: var(--color-secondary-300);
    transform: translateX(4px);
}

.no-entitlements {
    color: var(--color-surface-900);
    font-style: italic;
    font-size: 0.95rem;
    opacity: 0.7;
    padding: 20px;
    text-align: center;
}

/* Error messages */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error-700);
    padding: 16px;
    border-radius: 6px;
    margin: 20px 0;
    border-left: 4px solid var(--color-error-500);
    display: none;
}

.error-message.visible {
    display: block;
}

/* Alert boxes */
.alert {
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
    color: #1e40af;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--color-success-500);
    color: var(--color-success-700);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: var(--color-warning-500);
    color: #92400e;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--color-error-500);
    color: var(--color-error-700);
}

/* Form text */
.form-text {
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--color-surface-900);
    opacity: 0.8;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container,
    .sr-main {
        padding: 20px;
    }

    .sr-root {
        padding: 20px 10px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .price-table-container {
        flex-direction: column;
        gap: 0;
    }

    .price-table-container section {
        border-right: none;
        border-bottom: 1px solid var(--color-surface-200);
        min-width: auto;
    }

    .price-table-container section:last-child {
        border-bottom: none;
    }

    .attribute-grid {
        grid-template-columns: 1fr;
    }

    .entitlements-list {
        grid-template-columns: 1fr;
    }

    .sr-header__logo img {
        max-width: 200px;
    }
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-20 {
    padding: 20px;
}
