/* Premium Minimal Design - Muslim Marriage Celebrant Style */

:root {
    color-scheme: light;
    --mmc-gold: #b59655;
    --mmc-gold-hover: #9f7f3f;
    --mmc-gold-soft: #f3ead7;
    --mmc-border: #e9e4d6;
    --mmc-text: #111111;
    --mmc-muted: #5b5b5b;
    --mmc-surface: #ffffff;
    --mmc-surface-alt: #fafafa;
    --mmc-overlay: rgba(0, 0, 0, 0.72);
    --mmc-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    --mmc-focus: #b59655;
    --mmc-danger: #b42318;

    --mmc-font-heading: "Cormorant Garamond", "EB Garamond", Georgia, serif;
    --mmc-font-body: "Montserrat", "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

    --mmc-radius-modal: 6px;
    --mmc-radius-btn: 4px;
    --mmc-radius-input: 4px;

    --mmc-spacing-xs: 8px;
    --mmc-spacing-sm: 12px;
    --mmc-spacing-md: 16px;
    --mmc-spacing-lg: 24px;
    --mmc-spacing-xl: 32px;

    /* Result page neutral colors */
    --mmc-result-bg: #f3ead7;
    --mmc-result-border: #e9e4d6;
    --mmc-result-bar-bg: #e0e0e0;
    --mmc-result-bar-fill: #b59655;
}

/* Base Reset inside Modal */
.mmc-overlay,
.mmc-overlay * {
    box-sizing: border-box;
}

/* Modal Overlay */
.mmc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--mmc-overlay);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Center horizontally and vertically */
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mmc-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Modal Panel */
.mmc-panel {
    background: var(--mmc-surface);
    border: 1px solid var(--mmc-border);
    border-radius: var(--mmc-radius-modal);
    box-shadow: var(--mmc-shadow);
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transform: translateY(10px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mmc-overlay.open .mmc-panel {
    transform: translateY(0) scale(1);
}

/* Accent Bar */
.mmc-accent {
    height: 3px;
    background: var(--mmc-gold);
    width: 100%;
    flex-shrink: 0;
}

/* Header */
.mmc-header {
    padding: var(--mmc-spacing-xl) var(--mmc-spacing-xl) 0 var(--mmc-spacing-xl);
    text-align: center;
    position: relative;
    flex-shrink: 0;
}

.mmc-title {
    font-family: var(--mmc-font-heading);
    font-size: 28px;
    line-height: 1.2;
    font-weight: 600;
    /* semi-bold */
    color: var(--mmc-text);
    margin: 0;
}

.mmc-subtitle {
    font-family: var(--mmc-font-body);
    font-size: 14px;
    color: var(--mmc-muted);
    margin: 8px 0 0 0;
}

.mmc-divider {
    width: 64px;
    height: 2px;
    background: var(--mmc-gold);
    margin: 14px auto 0;
}

/* Footer (Persistent) */
.mmc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px var(--mmc-spacing-xl);
    border-top: 1px solid var(--mmc-border);
    background: var(--mmc-surface);
    flex-shrink: 0;
    font-size: 11px;
    color: var(--mmc-muted);
}

.mmc-footer-left {
    font-weight: 500;
    color: var(--mmc-text);
}

.mmc-footer-right {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mmc-gold);
}

/* Footer Responsive */
@media(max-width: 600px) {
    .mmc-footer {
        flex-direction: column;
        gap: 6px;
        text-align: center;
        padding: 10px var(--mmc-spacing-md);
    }
}

/* Close Button */
.mmc-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: var(--mmc-text);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.mmc-close:hover {
    background: var(--mmc-gold-soft);
}

.mmc-close:focus {
    outline: 2px solid var(--mmc-focus);
    outline-offset: 2px;
}

/* Body */
.mmc-body {
    padding: var(--mmc-spacing-xl);
    flex: 1;
    overflow-y: auto;
    font-family: var(--mmc-font-body);
    font-size: 16px;
    color: var(--mmc-text);
    line-height: 1.55;
    display: flex;
    flex-direction: column;
    gap: var(--mmc-spacing-md);
}

/* Loading Spinner */
.mmc-loading {
    display: flex;
    justify-content: center;
    padding: 40px;
    color: var(--mmc-gold);
}

/* Forms & Inputs */
.mmc-form-group {
    margin-bottom: var(--mmc-spacing-md);
}

.mmc-label {
    display: block;
    font-family: var(--mmc-font-body);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
    color: var(--mmc-text);
}

.mmc-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    font-family: var(--mmc-font-body);
    font-size: 16px;
    color: var(--mmc-text);
    background: var(--mmc-surface);
    border: 1px solid var(--mmc-border);
    border-radius: var(--mmc-radius-input);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mmc-input:focus {
    outline: none;
    border-color: var(--mmc-focus);
    box-shadow: 0 0 0 1px var(--mmc-focus);
}

/* Buttons */
.mmc-btn-primary,
.mmc-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 22px;
    border-radius: var(--mmc-radius-btn);
    font-family: var(--mmc-font-body);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    /* Match premium style often seen */
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    width: 100%;
    /* Mobile default */
}

.mmc-btn-primary {
    background: var(--mmc-gold);
    color: #ffffff;
}

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

.mmc-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.mmc-btn-secondary {
    background: transparent;
    color: var(--mmc-muted);
}

.mmc-btn-secondary:hover {
    color: var(--mmc-text);
    text-decoration: underline;
}

/* Actions Footer (Inside Body usually, or split) */
.mmc-actions {
    display: flex;
    gap: var(--mmc-spacing-md);
    margin-top: var(--mmc-spacing-lg);
    flex-direction: column-reverse;
    /* Stack buttons on mobile with Next on top */
}

@media(min-width: 600px) {
    .mmc-actions {
        flex-direction: row;
        justify-content: space-between;
    }

    .mmc-btn-primary,
    .mmc-btn-secondary {
        width: auto;
    }
}

/* Question Styles */
.mmc-question-text {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: var(--mmc-spacing-lg);
    text-align: center;
}

.mmc-progress {
    height: 4px;
    background: #eee;
    margin-bottom: 20px;
    border-radius: 2px;
}

.mmc-progress-fill {
    height: 100%;
    background: var(--mmc-gold);
    transition: width 0.3s ease;
}

.mmc-section-badge {
    text-align: center;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--mmc-muted);
    margin-bottom: 10px;
}

/* Setup / Radio Options */
.mmc-radio-vertical label {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--mmc-border);
    border-radius: var(--mmc-radius-input);
    margin-bottom: 8px;
    cursor: pointer;
    background: var(--mmc-surface-alt);
    transition: all 0.2s;
}

.mmc-radio-vertical label:hover {
    border-color: var(--mmc-gold);
    background: var(--mmc-surface);
}

.mmc-radio-vertical input {
    margin-right: 12px;
    margin-top: 0;
    margin-bottom: 0;
    accent-color: var(--mmc-gold);
    width: 20px;
    height: 20px;
    min-width: 20px;
    /* Prevent shrink */
    min-height: 20px;
    flex-shrink: 0;
}

/* Scale 1-5 */
.mmc-scale-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    /* Align bottom */
    margin: 30px 0;
    padding-bottom: 5px;
    position: relative;
}

/* Line behind circles */
.mmc-scale-container::before {
    content: '';
    position: absolute;
    top: 60%;
    /* Adjust for circle center roughly */
    left: 20px;
    right: 20px;
    height: 1px;
    background: var(--mmc-border);
    z-index: 0;
}

.mmc-scale-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    cursor: pointer;
    flex: 1;
}

.mmc-scale-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.mmc-scale-circle {
    width: 44px;
    height: 44px;
    background: var(--mmc-surface);
    border: 1px solid var(--mmc-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mmc-font-heading);
    font-size: 18px;
    color: var(--mmc-muted);
    transition: all 0.2s;
    margin-top: 8px;
}

.mmc-scale-option:hover .mmc-scale-circle {
    border-color: var(--mmc-gold);
    color: var(--mmc-gold);
}

.mmc-scale-option input:checked+.mmc-scale-circle {
    background: var(--mmc-gold);
    border-color: var(--mmc-gold);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(181, 150, 85, 0.4);
}

.mmc-scale-label {
    font-size: 12px;
    color: var(--mmc-muted);
    text-align: center;
    min-height: 28px;
    /* Two lines allowance */
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

@media(max-width: 500px) {
    .mmc-scale-container {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .mmc-scale-container::before {
        display: none;
    }

    .mmc-scale-option {
        flex-direction: row;
        justify-content: space-between;
        padding: 10px;
        background: var(--mmc-surface-alt);
        border: 1px solid var(--mmc-border);
        border-radius: var(--mmc-radius-input);
    }

    .mmc-scale-circle {
        order: 2;
        width: 32px;
        height: 32px;
        font-size: 16px;
        margin: 0;
    }

    .mmc-scale-label {
        order: 1;
        min-height: auto;
        font-size: 14px;
    }

    /* Hide circle background when checked in list mode? Or keep it. */
    .mmc-scale-option input:checked+.mmc-scale-circle {
        transform: scale(1);
    }
}

/* Yes/No Options */
.mmc-yesno-container {
    display: flex;
    gap: 12px;
}

.mmc-yesno-option {
    flex: 1;
    cursor: pointer;
}

.mmc-yesno-option input {
    display: none;
}

.mmc-yesno-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    border: 1px solid var(--mmc-border);
    background: var(--mmc-surface-alt);
    border-radius: var(--mmc-radius-input);
    color: var(--mmc-muted);
    font-weight: 500;
    transition: all 0.2s;
}

.mmc-yesno-option:hover span {
    border-color: var(--mmc-gold);
    color: var(--mmc-text);
}

.mmc-yesno-option input:checked+span {
    background: var(--mmc-gold);
    border-color: var(--mmc-gold);
    color: white;
}

/* Page Container (A4-like) */
.mmc-page-container {
    background: #ffffff;
    max-width: 680px;
    margin: 0 auto;
    padding: 40px;
    min-height: 600px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    border-radius: 4px;
    position: relative;
    color: var(--mmc-text);
}

.mmc-page-title {
    font-family: var(--mmc-font-heading);
    font-size: 24px;
    font-weight: 600;
    color: var(--mmc-text);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

/* Page 1: Cover */
.mmc-cover-details {
    margin-bottom: 40px;
}

.mmc-cover-label {
    font-size: 13px;
    color: var(--mmc-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.mmc-cover-value {
    font-size: 18px;
    color: var(--mmc-text);
    font-weight: 500;
    margin-bottom: 16px;
    font-family: var(--mmc-font-heading);
}

.mmc-authority-block {
    background: var(--mmc-surface-alt);
    padding: 30px;
    border-radius: 6px;
    border: 1px solid var(--mmc-border);
}

/* Page 3: Overall */
.mmc-overall-band {
    font-family: var(--mmc-font-heading);
    font-size: 36px;
    color: var(--mmc-gold);
    margin-bottom: 8px;
    line-height: 1.2;
}

.mmc-overall-percent {
    font-size: 14px;
    color: var(--mmc-muted);
    margin-bottom: 24px;
}

/* Page 4: Pillars */
.mmc-pillar-card {
    background: #fff;
    border: 1px solid var(--mmc-border);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.mmc-pillar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.mmc-pillar-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--mmc-text);
}

.mmc-pillar-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--mmc-surface-alt);
    color: var(--mmc-gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Page 5: Growth */
.mmc-growth-item {
    margin-bottom: 30px;
    padding-left: 20px;
    border-left: 3px solid var(--mmc-gold);
}

.mmc-growth-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--mmc-text);
}

/* Footer Controls */
.mmc-footer-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mmc-page-display {
    font-size: 12px;
    color: var(--mmc-muted);
    min-width: 80px;
    text-align: center;
}

.mmc-nav-btn {
    background: transparent;
    border: 1px solid var(--mmc-border);
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--mmc-text);
    transition: all 0.2s;
}

.mmc-nav-btn:hover:not(:disabled) {
    border-color: var(--mmc-gold);
    color: var(--mmc-gold);
}

.mmc-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .mmc-page-container {
        padding: 20px;
        min-height: auto;
    }

    .mmc-overlay {
        padding: 10px;
        align-items: flex-start;
    }

    .mmc-panel {
        max-height: 95vh;
        margin-top: 10px;
    }

    .mmc-header {
        padding: var(--mmc-spacing-lg) var(--mmc-spacing-md) 0 var(--mmc-spacing-md);
    }

    .mmc-body {
        padding: var(--mmc-spacing-lg) var(--mmc-spacing-md);
    }

    .mmc-title {
        font-size: 24px;
    }

    .mmc-subtitle {
        font-size: 13px;
    }

    .mmc-question-text {
        font-size: 16px;
    }

    .mmc-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 22px;
    }

    .mmc-yesno-container {
        flex-direction: column;
    }

    .mmc-yesno-option span {
        height: 44px;
    }

    .mmc-footer {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .mmc-footer-controls {
        order: -1;
        /* Put controls on top in mobile footer if desired, or keep logic */
        width: 100%;
        justify-content: center;
    }

    .mmc-footer-left,
    .mmc-footer-right {
        font-size: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .mmc-overlay {
        padding: 5px;
    }

    .mmc-panel {
        max-height: 98vh;
        border-radius: 4px;
    }

    .mmc-header {
        padding: var(--mmc-spacing-md) var(--mmc-spacing-sm) 0 var(--mmc-spacing-sm);
    }

    .mmc-body {
        padding: var(--mmc-spacing-md) var(--mmc-spacing-sm);
        font-size: 15px;
    }

    .mmc-title {
        font-size: 22px;
    }

    .mmc-subtitle {
        font-size: 12px;
    }

    .mmc-question-text {
        font-size: 15px;
        margin-bottom: var(--mmc-spacing-md);
    }

    .mmc-radio-vertical label {
        align-items: center;
        /* Ensure vertical center */
        justify-content: flex-start;
        /* Correct standard alignment */
    }

    .mmc-close {
        top: 8px;
        right: 8px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }

    .mmc-btn-primary,
    .mmc-btn-secondary {
        height: 42px;
        font-size: 14px;
        padding: 0 18px;
    }

    .mmc-actions {
        gap: 10px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    .mmc-overlay,
    .mmc-panel,
    .mmc-close,
    .mmc-btn-primary,
    .mmc-btn-secondary,
    .mmc-scale-circle,
    .mmc-nav-btn {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }

    .mmc-overlay.open .mmc-panel {
        transform: none;
    }
}