/**
 * Claim Form S3 Frontend - Main Styles
 * Based on WordPress Plugin Styling with SCS Brand Colors
 */

/* CSS Variables - SCS Brand Colors */
:root {
    --scs-everest-green: #424F33;
    --scs-hakone-gold: #C4A682;
    --scs-white: #ffffff;
    --scs-gray: #666666;
    --scs-light-gray: #f9f7f4;
    --scs-dark-gray: #333333;
    --scs-border-gray: #ddd;
    --scs-red: #dc2626;
    --scs-green: #46b450;
    --scs-blue: #0073aa;
    --scs-success-green: #28a745;

    /* Spacing */
    --spacing-xs: 0.25em;
    --spacing-sm: 0.5em;
    --spacing-md: 1em;
    --spacing-lg: 1.5em;
    --spacing-xl: 2em;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* Container */
    --container-max-width: 1600px;
}

/* Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--scs-dark-gray);
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

/* App Container */
#app {
    min-height: 100vh;
}

/* ==========================================================================
   Main Form Container - WordPress Style
   ========================================================================== */
.form-container {
    max-width: var(--container-max-width);
    margin: 2em auto;
    padding: 2em;
    background: #fff;
    border: 1px solid var(--scs-border-gray);
    border-radius: var(--radius-lg);
}

/* ==========================================================================
   Header - WordPress Style
   ========================================================================== */
.form-header {
    margin-bottom: 2em;
    padding-bottom: 1em;
    border-bottom: 2px solid var(--scs-hakone-gold);
}

.header-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo {
    height: 50px;
    width: auto;
}

.form-title {
    margin: 0;
    color: var(--scs-everest-green);
    font-size: 1.75rem;
    font-weight: 600;
}

/* ==========================================================================
   Progress Indicator - WordPress Style
   ========================================================================== */
.progress-container {
    margin: 2em 0;
    padding: 1em 0;
    border-bottom: 2px solid var(--scs-hakone-gold);
}

.progress-bar {
    display: flex;
    justify-content: space-between;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 0.5em;
    opacity: 0.5;
}

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

.progress-step.completed {
    opacity: 0.8;
}

.step-badge {
    display: inline-block;
    width: 45px;
    height: 45px;
    line-height: 45px;
    border-radius: 50%;
    background: var(--scs-border-gray);
    color: var(--scs-gray);
    font-weight: bold;
    font-size: 14px;
}

/* Hide the Config step from users */
.progress-step[data-step="0"] {
    display: none;
}

.progress-step.active .step-badge {
    background: var(--scs-everest-green);
    color: #fff;
}

.progress-step.completed .step-badge {
    background: var(--scs-hakone-gold);
    color: var(--scs-everest-green);
}

/* ==========================================================================
   Form Pages - WordPress Style
   ========================================================================== */
.form-page {
    display: none;
    min-height: 400px;
    margin: 2em 0;
}

.form-page.active {
    display: block;
}

.page-content {
    margin: 1.5em 0;
    line-height: 1.6;
}

/* ==========================================================================
   Section Titles - WordPress Style
   ========================================================================== */
.section-title {
    margin-top: 0;
    margin-bottom: 1em;
    color: var(--scs-everest-green);
    border-bottom: 2px solid var(--scs-hakone-gold);
    padding-bottom: 0.5em;
    font-size: 1.5rem;
    font-weight: 600;
}

.subsection-title {
    margin: 0 0 1em 0;
    padding-bottom: 0.5em;
    color: var(--scs-everest-green);
    border-bottom: 2px solid var(--scs-hakone-gold);
    font-size: 1.1em;
    font-weight: 600;
}

/* ==========================================================================
   HTML Content Areas - WordPress Style
   ========================================================================== */
.html-content {
    margin: 1em 0;
    line-height: 1.6;
}

.html-content p {
    margin-bottom: 0.75em;
}

.html-content ul,
.html-content ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}

.html-content li {
    margin-bottom: 0.5em;
}

.html-content h1,
.html-content h2,
.html-content h3,
.html-content h4,
.html-content h5,
.html-content h6 {
    color: var(--scs-everest-green);
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.html-content a {
    color: var(--scs-blue);
    text-decoration: underline;
}

.html-content a:hover {
    color: var(--scs-everest-green);
}

/* Page Description Box */
.page-description,
.section-description {
    margin: 1em 0;
    padding: 1em;
    background: var(--scs-light-gray);
    border-left: 4px solid var(--scs-hakone-gold);
    font-size: 14px;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   Error Messages - WordPress Style
   ========================================================================== */
.error-container {
    padding: 1em;
    background: #fff0f0;
    border-left: 4px solid var(--scs-red);
    margin: 1em 0;
    border-radius: var(--radius-sm);
}

.error-container h4 {
    color: var(--scs-red);
    margin: 0 0 0.5em 0;
}

.error-container ul {
    color: var(--scs-red);
    margin: 0;
    padding-left: 1.5em;
}

.error-container li {
    margin-bottom: 0.25em;
}

/* ==========================================================================
   Navigation Buttons - WordPress Style
   ========================================================================== */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 2em;
    padding-top: 1em;
    border-top: 2px solid var(--scs-hakone-gold);
}

.btn {
    padding: 0.75em 2em;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: var(--scs-border-gray);
    color: var(--scs-everest-green);
}

.btn-secondary:hover:not(:disabled) {
    background: #ccc;
}

.btn-primary {
    background: var(--scs-everest-green);
    color: #fff;
    margin-left: auto;
}

.btn-primary:hover:not(:disabled) {
    background: #36402a;
}

.btn-submit {
    background: var(--scs-hakone-gold);
    color: var(--scs-everest-green);
}

.btn-submit:hover:not(:disabled) {
    background: #b49670;
}

.btn-danger {
    background: #dc3232;
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #a00;
}

.btn-success {
    background: var(--scs-success-green);
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
}

/* ==========================================================================
   Footer - WordPress Style
   ========================================================================== */
.form-footer {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid var(--scs-border-gray);
    text-align: center;
    color: var(--scs-gray);
    font-size: 14px;
}

/* ==========================================================================
   Modal - WordPress Style
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--scs-everest-green);
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 24px;
}

/* Success Modal */
.success-modal {
    text-align: center;
    padding: 2em;
}

.success-modal h2 {
    color: var(--scs-green);
    margin: 1em 0 0.5em;
}

.success-modal p {
    color: var(--scs-gray);
    margin-bottom: 1.5em;
}

.success-icon {
    margin-bottom: 1em;
}

/* ==========================================================================
   Help Button - Navigation Bar Style
   ========================================================================== */
.btn-help {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.75em 1.5em;
    background: transparent;
    color: var(--scs-everest-green);
    border: 2px solid var(--scs-everest-green);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-left: auto;
    margin-right: 12px;
}

.btn-help:hover {
    background: var(--scs-everest-green);
    color: var(--scs-white);
}

.btn-help svg {
    width: 18px;
    height: 18px;
}

/* When help button is present, push it and next button to the right */
.navigation-buttons .btn-help ~ .btn-primary,
.navigation-buttons .btn-help ~ .btn-submit {
    margin-left: 0;
}

/* Help modal content styling */
.help-item {
    padding: 16px;
    margin-bottom: 16px;
    background: var(--scs-light-gray);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--scs-hakone-gold);
}

.help-item:last-child {
    margin-bottom: 0;
}

.help-item-title {
    margin: 0 0 8px 0;
    color: var(--scs-everest-green);
    font-size: 1rem;
    font-weight: 600;
}

.help-item-content {
    color: var(--scs-gray);
    font-size: 0.9rem;
    line-height: 1.6;
}

.help-item-content p {
    margin: 0 0 8px 0;
}

.help-item-content p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Loading Overlay
   ========================================================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--scs-light-gray);
    border-top-color: var(--scs-everest-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1em;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: var(--scs-gray);
    font-size: 1rem;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.reflex-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--scs-success-green);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.reflex-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.reflex-toast-error {
    background: #dc3545;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    .form-container {
        margin: 1em;
        padding: 1em;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .form-title {
        font-size: 1.25rem;
    }

    .progress-bar {
        gap: 0.25em;
        flex-wrap: wrap;
    }

    .step-badge {
        width: 24px;
        height: 24px;
        line-height: 24px;
        font-size: 10px;
    }

    .navigation-buttons {
        flex-direction: column;
        gap: 0.5em;
    }

    .btn {
        width: 100%;
        text-align: center;
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .section-title {
        font-size: 1.25rem;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-error {
    color: var(--scs-red);
}

.text-success {
    color: var(--scs-green);
}

.text-muted {
    color: var(--scs-gray);
}

.required {
    color: var(--scs-red);
    font-weight: bold;
    margin-left: 2px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .form-header,
    .progress-container,
    .navigation-buttons,
    .form-footer {
        display: none;
    }

    .form-container {
        margin: 0;
        padding: 0;
        max-width: none;
        border: none;
    }

    .form-page {
        display: block !important;
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   Form Not Found Page
   ========================================================================== */
.form-not-found-page {
    text-align: center;
    padding: 3em 2em;
    max-width: 600px;
    margin: 0 auto;
}

.not-found-icon {
    margin-bottom: 1.5em;
}

.not-found-icon svg {
    color: var(--scs-hakone-gold);
}

.not-found-title {
    color: var(--scs-everest-green);
    font-size: 2rem;
    margin: 0 0 1em 0;
    font-weight: 600;
}

.not-found-message {
    color: var(--scs-gray);
    font-size: 1.1rem;
    margin-bottom: 1em;
    line-height: 1.6;
}

.not-found-reasons {
    text-align: left;
    color: var(--scs-gray);
    margin: 0 auto 2em auto;
    max-width: 400px;
    padding-left: 1.5em;
}

.not-found-reasons li {
    margin-bottom: 0.5em;
    line-height: 1.5;
}

.not-found-contact {
    background: var(--scs-light-gray);
    border-radius: var(--radius-lg);
    padding: 2em;
    margin: 2em 0;
    border-left: 4px solid var(--scs-hakone-gold);
}

.not-found-contact h3 {
    color: var(--scs-everest-green);
    margin: 0 0 0.5em 0;
    font-size: 1.25rem;
}

.not-found-contact > p {
    color: var(--scs-gray);
    margin-bottom: 1.5em;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75em;
    color: var(--scs-dark-gray);
}

.contact-item svg {
    flex-shrink: 0;
    color: var(--scs-everest-green);
}

.contact-item a {
    color: var(--scs-blue);
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

.not-found-actions {
    margin-top: 2em;
}

.not-found-actions .btn {
    display: inline-block;
    text-decoration: none;
    padding: 1em 2em;
}

@media (max-width: 480px) {
    .not-found-title {
        font-size: 1.5rem;
    }

    .not-found-contact {
        padding: 1.5em;
    }
}
