/**
 * Civil Marriage Form Styles
 * Inspired by Utah Marriage Online design
 * Clean white background, professional appearance
 */

/* Import Google Font - Inter for clean, modern typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Container and Layout */
.mas-civil-form-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    direction: rtl;
    color: #333;
    line-height: 1.6;
}

/* Global font inheritance for all elements */
* {
    font-family: inherit;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Header Section */
.mas-civil-header {
    background: #1e2a38;
    color: white;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.mas-civil-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="1" fill="white" opacity="0.05"/><circle cx="10" cy="60" r="1" fill="white" opacity="0.05"/><circle cx="90" cy="40" r="1" fill="white" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.mas-civil-hero {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.mas-civil-logo {
    width: 250px;
    height: auto;
    margin-bottom: 20px;
}

.mas-civil-logo-text {
    background: white;
    color: #1e40af;
    font-size: 1.4rem;
    font-weight: 700;
    padding: 12px 30px;
    border-radius: 50px;
    margin-bottom: 20px;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mas-civil-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mas-civil-subtitle {
    font-size: 1.2rem;
    margin: 0;
    opacity: 0.9;
    font-weight: 300;
}

/* Progress Indicator */
.mas-progress-container {
    background: #f8f9fa;
    padding: 40px 20px;
    border-bottom: 1px solid #e9ecef;
}

.mas-progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 10px;
}

.mas-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0.5;
    transition: all 0.3s ease;
    min-width: 120px;
}

.mas-progress-step.active {
    opacity: 1;
}

.mas-progress-step.current .mas-step-number {
    background: #1e2a38;
    color: white;
    box-shadow: 0 0 0 4px rgba(30, 42, 56, 0.2);
}

.mas-step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.mas-progress-step.active .mas-step-number {
    background: #1e2a38;
    color: white;
}

.mas-step-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #6c757d;
}

.mas-progress-step.active .mas-step-name {
    color: #333;
}

/* Clickable progress steps */
.mas-progress-step.clickable {
    cursor: pointer;
}

.mas-progress-step.clickable .mas-step-number {
    cursor: pointer;
    transition: all 0.2s ease;
}

.mas-progress-step.clickable:hover .mas-step-number {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(30, 42, 56, 0.3);
}

.mas-progress-step.clickable .mas-step-number:active {
    transform: scale(1.05);
}

.mas-progress-step a {
    text-decoration: none;
    color: inherit;
    display: contents;
}

.mas-progress-line {
    flex: 1;
    height: 2px;
    background: #e9ecef;
    margin: 0 10px;
    max-width: 100px;
    transition: all 0.3s ease;
}

.mas-progress-line.completed {
    background: #28a745;
}

/* Step Container */
.mas-step-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px;
    background: white;
}

.mas-step-content h2 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
    text-align: center;
}

.mas-step-description {
    text-align: center;
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0 0 40px 0;
}

/* Form Styles */
.mas-form {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

/* Partner Sections Container */
.partner-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .partner-sections {
        grid-template-columns: 1fr;
    }
}

/* Individual Partner Section */
.partner-section {
    background: #ffffff;
    border: 2px solid #1e2a38;
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
}

.partner-section h3 {
    color: #1e2a38;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.mas-form-group {
    margin-bottom: 20px;
}

.mas-form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-size: 0.95rem;
}

.mas-form input[type="text"],
.mas-form input[type="email"],
.mas-form input[type="date"],
.mas-form input[type="tel"],
.mas-form select {
    width: 100%;
    max-width: 100%;
    padding: 10px 14px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #ffffff;
    direction: ltr;
    text-align: left;
    box-sizing: border-box;
}

.mas-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.mas-form input::placeholder {
    color: #6c757d;
    font-style: italic;
    direction: rtl;
    text-align: right;
}

/* Checkbox Styles */
.mas-checkbox-group {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    position: relative;
    padding-right: 35px;
    margin-bottom: 15px;
}

.mas-checkbox-group input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.mas-checkmark {
    position: absolute;
    right: 0;
    top: 2px;
    height: 20px;
    width: 20px;
    background-color: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mas-checkbox-group:hover .mas-checkmark {
    border-color: #667eea;
}

.mas-checkbox-group input:checked ~ .mas-checkmark {
    background-color: #667eea;
    border-color: #667eea;
}

.mas-checkmark:after {
    content: "";
    position: absolute;
    display: none;
    right: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.mas-checkbox-group input:checked ~ .mas-checkmark:after {
    display: block;
}

.mas-checkbox-text {
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

/* Radio Button Styles */
.mas-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mas-radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.mas-radio-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.mas-radio-option input[type="radio"] {
    margin-left: 12px;
    transform: scale(1.2);
    accent-color: #667eea;
}

.mas-radio-option input:checked {
    background: #667eea;
}

.mas-radio-option input:checked + .mas-radio-mark + span {
    font-weight: 600;
    color: #667eea;
}

/* Partners Container */
.mas-partners-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .mas-partners-container {
        grid-template-columns: 1fr 1fr;
    }
}

.mas-partner-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.mas-partner-section h3 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.mas-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (min-width: 600px) {
    .mas-form-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Button Styles */
.mas-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    gap: 15px;
    flex-wrap: wrap;
}

.mas-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    min-width: 140px;
    justify-content: center;
}

.mas-btn-primary {
    background: #1e2a38;
    color: white;
    box-shadow: 0 4px 15px rgba(30, 42, 56, 0.3);
}

.mas-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 42, 56, 0.4);
}

.mas-btn-secondary {
    background: #ffffff;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.mas-btn-secondary:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
}

.mas-btn-arrow {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Homepage CTA */
.mas-homepage-cta {
    text-align: center;
    margin: 40px 0;
}

.mas-cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 18px 35px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.mas-cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

/* Error Messages */
.mas-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin-top: 20px;
    text-align: center;
    font-weight: 500;
}

.mas-success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #c3e6cb;
    margin-top: 20px;
    text-align: center;
    font-weight: 500;
}

/* Loading States */
.mas-loading {
    opacity: 0.6;
    pointer-events: none;
}

.mas-loading .mas-btn {
    position: relative;
}

.mas-loading .mas-btn::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: mas-spin 1s linear infinite;
}

@keyframes mas-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Header */
    .mas-civil-header {
        padding: 40px 15px;
    }

    .mas-civil-logo {
        width: 180px;
    }

    .mas-civil-logo-text {
        font-size: 1.1rem;
        padding: 10px 24px;
    }

    .mas-civil-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .mas-civil-subtitle {
        font-size: 1rem;
    }

    /* Progress Bar */
    .mas-progress-container {
        padding: 30px 15px;
    }
    
    .mas-progress-bar {
        gap: 15px;
    }

    .mas-progress-step {
        min-width: 100px;
        font-size: 0.85rem;
    }

    .mas-step-number {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .mas-step-name {
        font-size: 0.85rem;
    }
    
    .mas-progress-line {
        width: 30px;
    }

    /* Form Container */
    .mas-step-container {
        padding: 30px 15px;
    }

    .mas-step-content h2 {
        font-size: 1.6rem;
    }

    .mas-step-description {
        font-size: 0.95rem;
    }
    
    .mas-form {
        padding: 25px 15px;
    }

    /* Form Groups */
    .mas-form-group {
        margin-bottom: 20px;
    }

    .mas-form-label {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }

    .mas-form-input,
    .mas-form-select,
    .mas-form-textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 15px;
    }

    /* Partner Sections */
    .partner-sections {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .partner-section {
        padding: 25px 15px;
    }

    .partner-section h3 {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }

    /* Form Actions */
    .mas-form-actions {
        flex-direction: column;
        gap: 12px;
        padding: 20px 15px;
    }
    
    .mas-btn {
        width: 100%;
        padding: 14px 24px;
        font-size: 1rem;
        min-height: 48px; /* Touch target */
    }

    /* File Upload */
    .mas-file-upload-box {
        padding: 30px 15px;
        min-height: 200px;
    }

    .mas-file-upload-icon {
        font-size: 2.5rem;
    }

    .mas-file-upload-text {
        font-size: 0.95rem;
    }

    .mas-file-hint {
        font-size: 0.85rem;
    }

    /* File Preview */
    .mas-file-preview {
        flex-direction: column;
        gap: 15px;
    }

    .mas-file-info h4 {
        font-size: 0.95rem;
    }

    .mas-file-info p {
        font-size: 0.85rem;
    }

    /* Camera Capture */
    .mas-camera-container {
        max-width: 100%;
        margin: 15px 0;
    }

    /* Checkbox/Radio Groups */
    .mas-checkbox-label,
    .mas-radio-label {
        font-size: 0.95rem;
        padding-right: 35px;
        min-height: 44px; /* Touch target */
        align-items: center;
    }

    .mas-checkmark {
        width: 22px;
        height: 22px;
    }

    /* Payment Section */
    .payment-info,
    .payment-instructions {
        padding: 20px 15px;
    }

    .payment-amount {
        font-size: 1.8rem;
    }

    /* Document Upload Grid */
    .document-upload-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Signature Section */
    .signature-container {
        padding: 20px 15px;
    }

    .signature-canvas {
        max-width: 100%;
        height: 200px;
    }

    /* Alert Messages */
    .mas-alert {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    /* Input Notes */
    .input-note {
        font-size: 0.8rem;
    }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
    .mas-civil-title {
        font-size: 1.5rem;
    }

    .mas-civil-logo {
        width: 150px;
    }

    .mas-progress-step {
        min-width: 80px;
        font-size: 0.75rem;
    }

    .mas-step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .mas-step-name {
        font-size: 0.75rem;
    }

    .mas-progress-line {
        width: 20px;
    }

    .mas-step-content h2 {
        font-size: 1.4rem;
    }

    .partner-section h3 {
        font-size: 1.1rem;
    }

    .mas-form {
        padding: 20px 10px;
    }

    .mas-btn {
        font-size: 0.95rem;
        padding: 12px 20px;
    }
}

/* Accessibility */
.mas-form input:focus,
.mas-form button:focus,
.mas-checkbox-group:focus-within .mas-checkmark,
.mas-radio-option:focus-within {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Animation for smooth transitions */
.mas-step-container {
    animation: mas-fade-in 0.5s ease-out;
}

@keyframes mas-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Continue button - arrow on LEFT side */
#continue-btn,
.mas-btn-next {
    flex-direction: row;
    direction: ltr;
}

/* Homepage back button - matches primary button style */
.form-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-direction: row-reverse;
    direction: rtl;
    padding: 14px 28px;
    background: #1e2a38;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 42, 56, 0.3);
    min-width: 140px;
    justify-content: center;
}

.form-back-btn:hover {
    background: #2d3e50;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 42, 56, 0.4);
}

/* Floating WhatsApp Button */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    text-decoration: none;
    animation: whatsapp-pulse 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    animation: none;
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
    fill: white;
}

@keyframes whatsapp-pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.6);
    }
}

/* Mobile responsive WhatsApp button */
@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
}