/* ==========================================================================
   Namerica Common Form Styles
   - Author: Gemini AI
   - Date: 2025-09-11
   - Description: Common styles for form sections, grids, fields,
                  question-answer rows, and buttons across the application.
   ========================================================================== */

/* 페이지 전체 배경색 */
   body {
    background-color: #f8f8f8;
    font-family: 'Roboto';
}

/* === 1. Form Layout & Structure === */

.form-wrapper {
    background-color: white;
    border-radius: 13px;
    box-shadow: 4px 4px 15px 0px rgba(224, 224, 224, 0.5);
    width: 996px;
    max-width: 95%;
    /* padding: 40px 48px 69px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px; */
    padding: 40px 48px;
    margin: 40px auto;
}

.form-header {
    text-align: center;
    padding: 25px 0;
    width: 100%;
}

.form-title {
    font-size: 24px;
    font-weight: 600;
    color: black;
    margin-bottom: 8px;
}

.form-description {
    font-size: 15px;
    color: #757575;
}

/* === 2. Form Section & Subsection === */

.form-section {
    width: 100%;
}

.section-header {
    border-bottom: 1px solid #cccccc;
    margin-bottom: 24px;
    padding-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-size: 17px;
    font-weight: 600;
}

/* === 3. Form Grid & Fields === */

.form-grid {
    display: grid;
    gap: 1rem 1.5rem;
}

.form-grid-2-cols {
    grid-template-columns: 1fr 1fr;
}

.form-grid-3-cols {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1rem;
    text-align: left;
}

.field-label {
    font-size: 14px;
    color: black;
    margin: 0;
}

.field-label .required-star {
    color: red;
}

.form-input {
    width: 100%;
    height: 43px;
    border: 1px solid #cccccc;
    border-radius: 6px;
    padding: 0 12px;
    font-size: 14px;
    box-sizing: border-box;
}

/* === 4. Question & Answer Styles (for Checklist & Tax Qs) === */

.question-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 20px 20px 5px 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(204, 204, 204, 0.5);
    gap: 15px;
}

.question-number {
    width: 32px;
    font-weight: 600;
    font-size: 15px;
    text-align: right;
    flex-shrink: 0;
}

.question-text {
    flex-grow: 1;
    font-weight: 600;
    font-size: 15px;
    text-align: left;
}

.answers-group {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    width: 15px;
    height: 15px;
}

.radio-option label {
    font-size: 14px;
    margin: 0;
    user-select: none;
    /* Prevents text selection on click */
}

/* Checklist Section */
.checklist-block {
    width: 90%;
    border: 1px solid rgba(204, 204, 204, 0.5);
    border-radius: 10px;
    padding: 20px 20px;
    margin-bottom: 17px;
}

.checklist-question-row {
    display: flex;
    align-items: center;
}

.checklist-title {
    flex-grow: 1;
    font-size: 20px;
    font-weight: 600;
}

.sub-checklist {
    margin-top: 28px;
}

.sub-checklist-title {
    font-size: 17px;
    font-weight: 500;
}

.sub-checklist-description {
    font-size: 12px;
    color: #757575;
    margin-bottom: 12px;
}

.requirement-row {
    border: 1px solid rgba(204, 204, 204, 0.7);
    border-radius: 10px;
    padding: 13px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.requirement-text {
    flex-grow: 1;
}

.requirement-title {
    font-size: 14px;
    font-weight: 500;
}

.requirement-description {
    font-size: 12px;
    color: #757575;
}

/* File Upload */
#clientPhotoLabel {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    display: block;
}

#clientPhotoLabel:hover {
    border-color: #007bff;
}

.file-input {
    display: none;
}

#photo-feedback {
    margin-top: 10px;
    color: #28a745;
    font-weight: bold;
}

/* === 5. Buttons === */

.button-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    width: 100%;
}

.btn {
    height: 38px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid #2882ff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 30px;
    text-decoration: none;
    font-weight: 500;
}

.btn-primary {
    background-color: #2882ff;
    color: white;
    width: 176px;
}

.btn-secondary {
    background-color: white;
    color: #2882ff;
    width: 176px;
}

.btn-skip {
    background-color: rgba(40, 130, 255, 0.2);
    color: #2882ff;
    border-color: rgba(40, 130, 255, 0.2);
}

/* === [ADD] Button State Styles === */
.btn-primary[disabled] {
    background-color: rgba(255, 95, 95, 0.3);
    /* Match skip button's bg */
    border-color: rgba(40, 130, 255, 0.2);
    cursor: not-allowed;
    opacity: 0.8;
}

.btn-skip[disabled] {
    background-color: #f8f9fa;
    /* Light grey */
    color: #adb5bd;
    /* Muted text */
    border-color: #dee2e6;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Enhanced style for warning messages */
.overall-checklist-warning {
    border-left: 5px solid #ffc107;
    background-color: #fff8e1;
    padding: 1rem;
    margin-top: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.overall-checklist-warning::before {
    content: "⚠️";
    /* Using emoji as a simple icon */
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.overall-checklist-warning.is-hidden {
    display: none;
}

/* [ADD] Shake animation for the warning message */
.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* === 11. Layout & Flex Utilities (from Bootstrap) === */
.d-flex {
    display: flex !important;
}

.justify-content-end {
    justify-content: flex-end !important;
}

.w-100 {
    width: 100% !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

/* === 12. Add Button Style for Dynamic Items === */
.add-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #f0f7ff;
    /* Light blue background */
    color: #2882ff;
    /* Primary blue text/icon */
    border: 1px solid #b3d7ff;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.add-button i {
    font-size: 1rem;
    /* Adjust icon size if needed */
}

.add-button:hover {
    background-color: #e3f2fd;
    border-color: #80bfff;
    box-shadow: 0 2px 5px rgba(40, 130, 255, 0.1);
}

/* === 12. Delete Button Style for Dynamic Items === */
.delete-button {
    background: none;
    border: 1px solid #e0e0e0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    padding: 0;
}

.delete-button i {
    stroke: #898f8f;
    /* Default icon color */
    transition: stroke 0.2s ease-in-out;
}

.delete-button:hover {
    background-color: #ffebee;
    /* Light red background on hover */
    border-color: #ffcdd2;
}

.delete-button:hover i {
    stroke: #dc3545;
    color: #dc3545;
    /* Red icon color on hover */
}

/* === 13. Tax Questionnaire Template Section === */
.question-row {
    flex-wrap: wrap;
    /* Allow wrapping for template section */
}

.template-download-section {
    width: 100%;
    margin-top: 15px;
    padding: 15px;
    background-color: #f0f7ff;
    border-left: 4px solid #2882ff;
    border-radius: 4px;
}

.template-info {
    font-size: 13px;
    color: #555;
    margin: 0 0 10px 0;
}

.template-download-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #fff;
    color: #2882ff;
    border: 1px solid #b3d7ff;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

.template-download-button:hover {
    background-color: #e3f2fd;
    border-color: #80bfff;
}


/* ==========================================================================
   [ADD] Responsive Styles
   ========================================================================== */

/* Tablet Breakpoint */
@media (max-width: 834px) {
    .form-wrapper {
        padding: 40px 30px 50px 30px;
    }

    .form-grid-2-cols,
    .form-grid-3-cols {
        grid-template-columns: 1fr;
    }

    .question-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .question-text {
        width: 100%;
        margin-bottom: 5px;
    }

    .answers-group {
        width: 100%;
        justify-content: flex-start;
    }

    .button-group {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-skip {
        width: 100%;
        height: 42px;
    }

    .button-group.no-stack {
        flex-direction: row;
        gap: 15px;
    }

    .button-group.no-stack .btn {
        width: auto;
        flex: 1;
    }
}

/* === 6. Email Verification UX Styles === */
.verified-input-wrapper {
    position: relative;
}

.verified-input-wrapper input[readonly] {
    cursor: pointer;
    background-color: #f8f9fa; /* Light gray to indicate it's clickable but not editable */
}

.verified-input-wrapper.verified input[readonly] {
    background-color: #e9f5e9; /* Light green for verified state */
    border-color: #28a745;
    color: #155724;
    cursor: not-allowed;
}

.verification-success-icon {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: #28a745;
    font-size: 1.2rem;
    display: none; /* Hidden by default */
}

.verified-input-wrapper.verified .verification-success-icon {
    display: block; /* Show icon when verified */
}

/* Mobile Breakpoint */
@media (max-width: 480px) {
    .form-wrapper {
        margin: 10px auto;
        padding: 20px 15px;
        gap: 20px;
    }

    .form-header {
        padding: 15px 0;
    }

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

    .form-description {
        font-size: 14px;
    }

    .section-title {
        font-size: 16px;
    }

    .spacer-70 {
        height: 70px;
    }
}