/* ==========================================================================
   GAUSA-1691: URG Application Styles
   Adapted from GAUSA aupairApplication.css for mobile-first registration
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    background-color: #f5f5f5;
    line-height: 1.3;
    color: #333;
}

input, select, textarea {
    color: #666;
    padding: 5px;
}

.container {
    max-width: 640px;
    margin: 20px auto;
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    position: relative;
}

.back-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.back-button svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #4684bc;
    stroke-width: 2;
}

h1 {
    font-size: 24px;
    font-weight: 400;
    color: #4684bc;
    margin: 0 auto;
    text-align: center;
}

/* ===== STEP CONTAINER ===== */
.step-container {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 25vh;
    margin-top: 5vh;
}

.question {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 0;
    color: #333;
    text-align: center;
    width: 100%;
}

.urg-subtitle {
    color: #555;
    font-size: 16px;
    text-align: center;
    margin-bottom: 10px;
    line-height: 1.5;
}

/* ===== FORM ELEMENTS ===== */
.form-container {
    width: 100%;
    max-width: 400px;
}

.form-group {
    position: relative;
    margin-bottom: 30px;
}

.form-control {
    width: 100%;
    padding: 10px 0;
    padding-left: 5px;
    font-size: 16px;
    border: none;
    border-bottom: 1px solid #ddd;
    outline: none;
    background: transparent;
    color: #666;
}

.form-label {
    position: absolute;
    left: 0;
    top: 10px;
    color: #666;
    font-size: 16px;
    transition: all 0.2s ease;
    pointer-events: none;
}

.form-control:focus ~ .form-label,
.form-control:not(:placeholder-shown) ~ .form-label {
    top: -15px;
    font-size: 14px;
    color: #4684bc;
}

.required-marker {
    color: #72141e;
}

/* Select styling */
select.form-control {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23666666%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 5px center !important;
    background-size: 10px auto !important;
    padding-right: 25px !important;
    border: none !important;
    border-bottom: 1px solid #ddd !important;
}

/* Field tip/hint text */
.field-tip,
.fieldTip {
    font-size: 13px;
    color: #888;
    margin-top: -25px;
    margin-bottom: 30px;
    line-height: 1.4;
}

.form-group + .field-tip,
.form-group + .fieldTip {
    margin-top: -25px;
}

/* ===== CONTINUE BUTTON ===== */
.continue-btn {
    display: block;
    padding: 12px;
    width: 100%;
    max-width: 300px;
    background-color: #4682B4;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    text-align: center;
    margin: 30px auto 0;
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    box-shadow: none;
}

.continue-btn:hover {
    background-color: #3a6fa0;
}

.continue-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.continue-btn.submitting {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== USER TYPE SELECTION (CARD STYLE) ===== */
.user-type-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 400px;
    margin: 30px auto 0;
}

.user-type-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}

.user-type-card:hover {
    border-color: #4682B4;
    background: #f8fbff;
}

.user-type-card.selected {
    border-color: #4682B4;
    background: #e9f2ff;
}

.user-type-card input[type="radio"] {
    display: none;
}

.user-type-card .card-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.user-type-card .card-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.user-type-card .card-content p {
    font-size: 14px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

/* ===== TOGGLE SWITCH (YES/NO) ===== */
.switch-container {
    display: flex;
    justify-content: center;
    padding: 10px 0 0 0;
    width: 100%;
}

.switch-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-label {
    color: #666;
    font-size: 16px;
    font-weight: 400;
    min-width: 35px;
    text-align: center;
    cursor: pointer;
    transition: color 0.2s ease;
}

.option-label:hover {
    color: #4b9bd4;
}

.switch {
    position: relative;
    width: 52px;
    height: 18px;
    background-color: #ccc;
    border-radius: 18px;
    cursor: pointer;
    display: flex;
}

.switch input[type="radio"] {
    opacity: 0;
    width: 50%;
    height: 100%;
    position: absolute;
    z-index: 2;
    cursor: pointer;
    margin: 0;
}

.switch .leftOption { left: 0; }
.switch .rightOption { right: 0; }

.slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    transition: .4s;
    pointer-events: none;
    border-radius: 18px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.rightOption:checked ~ .slider {
    background-color: #4b9bd4;
}

.rightOption:checked ~ .slider:before {
    transform: translateX(34px);
}

.leftOption:checked ~ .slider {
    background-color: #4b9bd4;
}

.leftOption:checked ~ .slider:before {
    transform: translateX(0);
}

.switch.unselected {
    background-color: #e0e0e0;
}

.switch .slider.middle:before {
    transform: translateX(17px);
}

/* ===== SCREENING QUESTION LAYOUT ===== */
.screening-question {
    margin-bottom: 30px;
}

.screening-question label {
    display: block;
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 400;
}

/* ===== DOB DATE SELECT ROW ===== */
.date-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.select-wrapper {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
    max-width: 150px;
}

.select-label {
    position: absolute;
    left: 0;
    top: 10px;
    color: #333;
    font-size: 16px;
    transition: all 0.2s ease;
    pointer-events: none;
}

.select-input {
    width: 100%;
    padding: 10px 0;
    font-size: 16px;
    border: none;
    border-bottom: 1px solid #ddd;
    outline: none;
    background: transparent;
    color: #666;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%234684bc%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 12px auto;
}

.select-input:focus ~ .select-label,
.select-input:not([value=""]) ~ .select-label,
.select-input.has-value ~ .select-label {
    top: -15px;
    font-size: 14px;
    color: #4684bc;
}

/* ===== INFO BOX ===== */
.info-box {
    background-color: #f5f5f5;
    border-left: 4px solid #4682B4;
    padding: 16px 8px;
    margin-bottom: 25px;
}

.info-box h2 {
    margin: 0 0 12px 0;
    font-size: 20px;
    color: #333;
    font-weight: 500;
}

.info-box p {
    margin: 0;
    color: #555;
    font-size: 15px;
    line-height: 1.6;
}

/* ===== EMAIL STATUS ===== */
.email-status {
    font-size: 13px;
    margin-top: 4px;
    display: block;
}

.email-status.error {
    color: #c91f3c;
    font-weight: 600;
}

.email-status.success {
    color: #0d6d28;
}

.email-status a {
    color: #4682B4;
    text-decoration: none;
    font-weight: 600;
}

.email-status a:hover {
    text-decoration: underline;
}

/* ===== VALIDATION ERRORS ===== */
.urg-error {
    background: #FCE4EC;
    color: #c91f3c;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

/* ===== AGREEMENT / TERMS CHECKBOXES ===== */
.agreement-section {
    margin: 20px 0;
    padding: 0;
}

.agreement-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 10px;
}

.agreement-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    margin-top: 0;
    cursor: pointer;
    accent-color: #0d6d28;
    flex-shrink: 0;
}

.agreement-item label {
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    color: #333;
}

.agreement-item a {
    color: #4682B4;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
}

.agreement-item a:hover {
    color: #3a6fa0;
    text-decoration: underline;
}

/* ===== POLICY MODALS (Terms / Privacy) ===== */
.policy-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.policy-modal-content {
    background-color: #fefefe;
    margin: 3% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.policy-modal-header {
    background-color: #72141e;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.policy-modal-header h2 {
    margin: 0;
    font-size: 1.3em;
}

.policy-modal-close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.policy-modal-close:hover {
    color: #ddd;
}

.policy-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
}

.policy-modal-body h2,
.policy-modal-body h3 {
    color: #72141e;
    margin-top: 20px;
    margin-bottom: 10px;
}

.policy-modal-body h2:first-child {
    margin-top: 0;
}

.policy-modal-body p {
    margin-bottom: 15px;
}

.policy-modal-body ul {
    margin-bottom: 15px;
    padding-left: 25px;
}

.policy-modal-body li {
    margin-bottom: 8px;
}

.policy-modal-body a {
    color: #72141e;
}

/* ===== INELIGIBLE SOFT LANDING ===== */
.ineligible-container {
    text-align: center;
    padding: 20px 0;
}

.ineligible-container h2 {
    font-size: 24px;
    font-weight: 400;
    color: #4684bc;
    margin-bottom: 15px;
}

.ineligible-container p {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.ineligible-container .continue-btn {
    display: inline-block;
    text-decoration: none;
    margin-top: 20px;
}

/* ===== SUBMIT SPINNER OVERLAY ===== */
.submit-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.submit-overlay.active {
    display: flex;
}

.submit-overlay .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4684bc;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.submit-overlay .spinner-text {
    color: #333;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
}

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

/* ===== PROGRESS INDICATOR ===== */
.urg-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 0 20px;
}

.urg-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e0e0e0;
    transition: background 0.3s ease;
}

.urg-progress-dot.active {
    background: #4682B4;
}

.urg-progress-dot.done {
    background: #34d399;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    body {
        padding-bottom: 0;
    }

    .container {
        margin: 0 auto;
        padding: 15px;
        border-radius: 0;
        box-shadow: none;
        position: relative;
        min-height: 100vh;
    }

    h1 {
        font-size: 20px;
    }

    .question {
        font-size: 22px;
        padding: 0 10px;
    }

    .step-container {
        width: 100%;
        align-items: center;
        justify-content: flex-start;
        padding: 0 10px;
        margin-top: 5vh !important;
    }

    .continue-btn {
        margin: 0 auto;
        height: 64px;
        font-size: 18px;
        max-width: 100%;
    }

    .step-container .continue-btn {
        position: fixed;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 32px);
        max-width: 608px;
        margin: 0;
        border-radius: 8px;
        z-index: 100;
        height: 70px;
        font-size: 20px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .date-container {
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }

    .select-wrapper {
        max-width: 100%;
    }

    .switch {
        height: 32px;
        width: 64px;
    }

    .slider:before {
        height: 26px;
        width: 26px;
        bottom: 3px;
    }

    .rightOption:checked ~ .slider:before {
        transform: translateX(32px);
    }

    .option-label {
        font-size: 18px;
        min-width: 45px;
    }

    /* User type cards stack nicely on mobile */
    .user-type-cards {
        gap: 12px;
    }

    .user-type-card {
        padding: 16px;
    }

    /* iOS form zoom prevention */
    select.form-control {
        font-size: 16px;
        padding: 8px 20px 8px 12px;
        line-height: 1.2;
    }

    /* Policy modals full screen on mobile */
    .policy-modal-content {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        max-height: 100%;
        border-radius: 0;
        border: none;
    }

    .policy-modal-close {
        position: fixed;
        top: 15px;
        right: 15px;
        background-color: rgba(255, 255, 255, 0.9);
        border-radius: 50%;
        width: 44px;
        height: 44px;
        line-height: 44px;
        text-align: center;
        font-size: 24px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
        color: #333;
    }

    .policy-modal-body {
        padding-bottom: 30px;
    }

    .policy-modal-header {
        margin-top: 0;
    }

    /* Bottom-fixed elements pattern */
    .bottom-elements {
        position: fixed;
        bottom: 20px;
        left: 15px;
        right: 15px;
        max-width: 100%;
        width: calc(100% - 30px);
        padding: 0;
        z-index: 90;
        background-color: white;
        padding-top: 10px;
    }
}

/* Desktop overrides */
@media (min-width: 769px) {
    .continue-btn,
    .step-container .continue-btn {
        position: static !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 300px !important;
        height: auto !important;
        padding: 12px !important;
        font-size: 16px !important;
        margin: 30px auto 0 auto !important;
        box-shadow: none !important;
    }

    .bottom-elements {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}
