/* MinHave — shared site styles */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --green-dark: #406328;
    --green-mid: #4a7a2e;
    --green-light: #6a9f4b;
    --green-pale: #b5c9a8;
    --sage: #c8d5bc;
    --bg: #f0f4ec;
    --bg-card: #ffffff;
    --text-primary: #2c2c2c;
    --text-secondary: #666;
    --text-muted: #999;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 50px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 8px 32px rgba(64, 99, 40, 0.15);
}

html { height: 100%; }

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    min-height: 100%;
    position: relative;
    overflow-x: hidden;
}

/* Watercolor leaf decorations */
body::before, body::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: 0;
    opacity: 0.08;
    background: radial-gradient(ellipse, var(--green-dark) 0%, transparent 70%);
}

body::before {
    width: 500px;
    height: 500px;
    top: -120px;
    right: -100px;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}

body::after {
    width: 400px;
    height: 400px;
    bottom: -80px;
    left: -80px;
    border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%;
}

/* Page wrapper */
.page-wrapper {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    padding: 8px 20px 48px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Page header */
.page-header {
    text-align: center;
    margin-bottom: 12px;
}

.brand {
    font-family: 'DM Serif Text', serif;
    font-size: 2.4rem;
    color: var(--green-dark);
    line-height: 1.1;
    margin-bottom: 4px;
    text-decoration: none;
}

a.brand:hover {
    opacity: 0.85;
}

.page-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* Nav header */
.nav-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 20px 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--green-dark);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: 20px;
    animation: fadeUp 0.5s ease-out both;
}

.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.16s; }

.card-accent {
    height: 3px;
    background: linear-gradient(90deg, var(--green-dark), var(--green-light), var(--green-dark));
}

.card-body {
    padding: 2.5rem 2rem;
}

.card-body h2 {
    font-family: 'Grape Nuts', cursive;
    font-size: 1.8rem;
    color: var(--green-dark);
    margin-bottom: 4px;
}

.card-body .subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-pill);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn:active {
    transform: translateY(0) !important;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    color: var(--green-dark);
    background: rgba(106, 159, 75, 0.12);
}

.btn-secondary:hover {
    background: rgba(106, 159, 75, 0.2);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    background: none;
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px 0;
    transition: color 0.2s;
}

.btn-back:hover {
    color: var(--green-dark);
}

.btn-back svg {
    width: 16px;
    height: 16px;
}

/* Form */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 0.4rem;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #ddd;
    border-radius: var(--radius-sm);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    color: #333;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--green-light);
    box-shadow: 0 0 0 3px rgba(106, 159, 75, 0.15);
    background: #fff;
}

.form-group input::placeholder {
    color: #bbb;
}

.form-group input[readonly] {
    background: #f0f0f0;
    color: #888;
    cursor: not-allowed;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--green-dark);
    flex-shrink: 0;
}

.checkbox-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    cursor: pointer;
}

/* Plan cards */
.plans-intro {
    text-align: center;
    margin-bottom: 24px;
}

.plans-intro h2 {
    font-family: 'Grape Nuts', cursive;
    font-size: 1.8rem;
    color: var(--green-dark);
    margin-bottom: 6px;
}

.plans-intro p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.plans-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: visible;
}

.plan-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 28px 24px;
    text-align: center;
    border: 2px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    animation: fadeUp 0.5s ease-out both;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.plan-card:nth-child(1) { animation-delay: 0.1s; }
.plan-card:nth-child(2) { animation-delay: 0.2s; }
.plan-card:nth-child(3) { animation-delay: 0.3s; }

.plan-card:hover {
    border-color: var(--green-pale);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.plan-card.selected {
    border-color: var(--green-dark);
    box-shadow: 0 8px 32px rgba(64, 99, 40, 0.22);
}

.plan-card.popular {
    border-color: var(--green-dark);
    padding-top: 36px;
}

.plan-card.popular:hover {
    border-color: var(--green-dark);
    box-shadow: 0 8px 32px rgba(64, 99, 40, 0.22);
}

.plan-badge {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 16px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

.plan-badge.promo {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
}

.plan-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.plan-original-price {
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-top: 8px;
}

.plan-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--green-dark);
    margin: 12px 0 4px;
    line-height: 1;
}

.plan-period {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.plan-savings {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--green-dark);
    background: rgba(106, 159, 75, 0.12);
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    margin-top: -12px;
    margin-bottom: 20px;
}

.plan-promo-note {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #c0392b;
    background: rgba(192, 57, 43, 0.08);
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    margin-top: -12px;
    margin-bottom: 20px;
}

.plan-features {
    list-style: none;
    margin-bottom: 20px;
    text-align: left;
    flex: 1;
}

.plan-features li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-features li::before {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(106, 159, 75, 0.12);
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23406328' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

.plan-select-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--green-dark);
    margin-top: auto;
    padding: 12px 24px;
    border: 2px solid var(--green-dark);
    border-radius: var(--radius-pill);
    transition: background 0.2s, color 0.2s;
}

.plan-card:hover .plan-select-label {
    background: var(--green-dark);
    color: #fff;
}

.plan-card.selected .plan-select-label {
    background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
    color: #fff;
    border-color: var(--green-dark);
}

/* User badge */
.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-dark), var(--green-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-status {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}

.user-status.active {
    background: rgba(106, 159, 75, 0.15);
    color: var(--green-dark);
}

.user-status.inactive {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
}

/* Subscription details */
.subscription-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.subscription-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(106, 159, 75, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.subscription-icon svg {
    width: 20px;
    height: 20px;
    color: var(--green-dark);
}

.subscription-label {
    font-family: 'Grape Nuts', cursive;
    font-size: 1.35rem;
    color: var(--green-dark);
}

.subscription-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.detail-item {
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.detail-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.provider-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

/* Selected plan summary */
.selected-plan-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 1.5rem;
}

.selected-plan-summary .plan-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.selected-plan-summary .plan-info .plan-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(106, 159, 75, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.selected-plan-summary .plan-info .plan-icon svg {
    width: 16px;
    height: 16px;
    color: var(--green-dark);
}

.selected-plan-summary .plan-info span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.selected-plan-summary .change-plan {
    font-size: 0.8rem;
    color: var(--green-dark);
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
}

.selected-plan-summary .change-plan:hover {
    text-decoration: underline;
}

/* Error message */
.error-message {
    background: #fdf0ef;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: #c0392b;
    display: none;
}

.error-message.visible {
    display: block;
}

/* Validation (for Umbraco forms) */
.validation-error {
    font-size: 0.8rem;
    color: #c0392b;
    margin-top: 0.3rem;
}

.validation-summary {
    background: #fdf0ef;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: #c0392b;
}

.validation-summary:empty {
    display: none;
}

/* Forgot password */
.forgot-password {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-top: -0.5rem;
    margin-bottom: 1.25rem;
    cursor: pointer;
}

.forgot-password:hover {
    color: var(--green-dark);
}

/* Loading overlay */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(240, 244, 236, 0.9);
    z-index: 100;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 16px;
}

.loading-overlay.visible {
    display: flex;
}

.loading-overlay .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--green-pale);
    border-top-color: var(--green-dark);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.loading-overlay p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-secondary .spinner {
    border-color: rgba(64, 99, 40, 0.2);
    border-top-color: var(--green-dark);
}

/* Footer links */
.logout-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}

.logout-link:hover {
    color: var(--green-dark);
}

.logout-link svg {
    width: 14px;
    height: 14px;
}

/* Steps (for auth wizard) */
.step {
    display: none;
    animation: fadeUp 0.4s ease-out both;
}

.step.active {
    display: block;
}

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.5); }
    to   { opacity: 1; transform: scale(1); }
}

/* Desktop */
@media (min-width: 768px) {
    .page-wrapper {
        padding: 16px 24px 64px;
    }

    .brand {
        font-size: 2.8rem;
    }

    .card-body {
        padding: 2.5rem 2rem;
    }

    .plans-grid {
        flex-direction: row;
    }

    .plan-card {
        flex: 1;
    }
}
