/* Rental Application Page Styles - Compact Mobile Layout */

.rental-application-section {
    padding: 30px 0;
    background: var(--bg-primary);
}

.form-section {
    padding: 0 0 20px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h2 {
    color: var(--elite-navy);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent-green);
    font-size: 1.3rem;
}

.form-section h3 {
    color: var(--text-secondary);
    margin: 16px 0 12px;
    font-size: 1rem;
}

.rental-application-section .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.rental-application-section .form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.rental-application-section .form-row-2 > .form-group {
    min-width: 0;
}

.rental-application-section .form-group {
    margin-bottom: 12px;
}

.rental-application-section .form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.rental-application-section .form-group input,
.rental-application-section .form-group select,
.rental-application-section .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rental-application-section .form-group input:focus,
.rental-application-section .form-group select:focus,
.rental-application-section .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(133, 176, 43, 0.1);
}

.radio-group, .checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

/* Modern Glossy Liquid Glass Radio Buttons */
.radio-label, .checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    gap: 8px;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;

    /* Glass morphism base */
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.8) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
}

/* Glossy highlight overlay */
.radio-label::before, .checkbox-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.1) 100%);
    border-radius: 12px 12px 50% 50%;
    pointer-events: none;
}

.radio-label:hover, .checkbox-label:hover {
    transform: translateY(-1px);
    box-shadow:
        0 6px 20px rgba(133, 176, 43, 0.2),
        0 3px 10px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    border-color: rgba(133, 176, 43, 0.4);
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(133, 176, 43, 0.1) 50%,
        rgba(255, 255, 255, 0.9) 100%);
}

.radio-label:active, .checkbox-label:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Selected state - green glass effect */
.radio-label:has(input:checked), .checkbox-label:has(input:checked) {
    background: linear-gradient(135deg,
        rgba(133, 176, 43, 0.25) 0%,
        rgba(133, 176, 43, 0.15) 50%,
        rgba(133, 176, 43, 0.2) 100%);
    border-color: rgba(133, 176, 43, 0.6);
    box-shadow:
        0 4px 20px rgba(133, 176, 43, 0.25),
        0 2px 8px rgba(133, 176, 43, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(133, 176, 43, 0.2);
}

.radio-label:has(input:checked)::before, .checkbox-label:has(input:checked)::before {
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.7) 0%,
        rgba(133, 176, 43, 0.1) 100%);
}

.radio-label input:checked + span,
.checkbox-label input:checked + span {
    color: #5a7a1f;
    font-weight: 600;
}

/* Hide default radio/checkbox, use custom styling */
.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #85b02b;
    position: relative;
    z-index: 1;
}

.radio-label span, .checkbox-label span {
    position: relative;
    z-index: 1;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.2s;
}

/* Compact radio/checkbox variants */
.radio-group-compact, .checkbox-group-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
}

.radio-group-compact .radio-label,
.radio-group-compact .checkbox-label,
.checkbox-group-compact .radio-label,
.checkbox-group-compact .checkbox-label {
    padding: 6px 10px;
    font-size: 0.85rem;
    border-radius: 10px;
    gap: 6px;
}

.radio-group-compact .radio-label input[type="radio"],
.radio-group-compact .checkbox-label input[type="checkbox"],
.checkbox-group-compact .radio-label input[type="radio"],
.checkbox-group-compact .checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Warning message styling */
.sa-id-warning {
    color: #b45309;
    font-size: 0.85rem;
    margin-top: 4px;
    font-style: italic;
}

.conditional-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.conditional-section.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.toggle-section {
    background: rgba(133, 176, 43, 0.1);
    border: 1px solid var(--accent-green);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.toggle-section label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 600;
    color: var(--elite-navy);
}

.toggle-section input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.char-counter {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.char-counter.warning {
    color: #f59e0b;
}

.char-counter.limit {
    color: #ef4444;
}

/* Occupant rows - Full Name + Age side by side */
.occupant-row {
    display: grid;
    grid-template-columns: 1fr 80px;
    gap: 8px;
    align-items: end;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
}

.occupant-row .form-group {
    margin-bottom: 0;
}

.occupant-row .remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
}

.occupant-number-input {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.occupant-number-input label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.occupant-number-input input[type="number"] {
    width: 80px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-align: center;
}

.occupant-pdf-note {
    font-size: 0.85rem;
    color: #b45309;
    font-style: italic;
    margin-top: 4px;
}

.add-btn {
    background: var(--accent-green);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Terms content - no scroll */
.terms-content {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.7rem;
    line-height: 1.4;
    text-align: justify;
}

.terms-content ol {
    padding-left: 20px;
}

.terms-content li {
    margin-bottom: 8px;
}

/* Terms checkbox dynamic styling */
.terms-checkbox-unchecked {
    border: 2px solid #ef4444 !important;
    background: rgba(239, 68, 68, 0.05) !important;
}

.terms-checkbox-checked {
    border: 2px solid var(--accent-green) !important;
    background: rgba(133, 176, 43, 0.1) !important;
}

/* Toggle switch for marketing communication */
.toggle-switch-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.toggle-switch-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
    background: var(--bg-secondary);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active {
    background: var(--accent-green);
    border-color: var(--accent-green);
}

.toggle-switch.active::before {
    transform: translateX(24px);
}

.toggle-switch:hover {
    border-color: var(--accent-green);
}

.toggle-switch-status {
    font-size: 0.85rem;
    font-weight: 500;
    min-width: 28px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.toggle-switch-status.active {
    color: var(--accent-green);
}

.toggle-switch-container input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.form-actions {
    text-align: center;
    margin-top: 24px;
}

.validation-summary {
    background: #fef2f2;
    border: 1px solid #ef4444;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #dc2626;
}

.validation-summary ul {
    margin: 0;
    padding-left: 20px;
}

.rental-application-section .text-danger {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 4px;
}

/* === Consent Verification Section === */
#consentVerificationSection {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

#consentVerificationSection h3 {
    margin-top: 0;
}

.consent-status-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    color: #2563eb;
    font-size: 0.9rem;
    font-weight: 500;
}

.bio-pulse {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #3b82f6;
    border-radius: 50%;
    animation: pulse-bio 1.2s ease-in-out infinite;
}

@keyframes pulse-bio {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.5; }
}

.consent-success {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.4);
    border-radius: 8px;
    color: #16a34a;
    font-size: 0.9rem;
    font-weight: 600;
}

.consent-fallback-notice {
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 8px;
    color: #b45309;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

#signaturePadContainer label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.signature-pad-wrapper {
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    touch-action: none;
    background: #fff;
}

.signature-pad-wrapper canvas {
    display: block;
    width: 100%;
    height: 200px;
    cursor: crosshair;
}

.btn-clear-signature {
    background: transparent;
    color: #ef4444;
    border: 1px solid #ef4444;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    min-height: 44px;
    min-width: 44px;
    transition: all 0.2s;
}

.btn-clear-signature:hover {
    background: #ef4444;
    color: #fff;
}

.signature-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Mobile breakpoints */
@media (max-width: 768px) {
    .rental-application-section {
        padding: 16px 0;
    }

    .form-section h2 {
        font-size: 1.15rem;
        margin-bottom: 12px;
    }

    .form-section h3 {
        font-size: 0.95rem;
        margin: 12px 0 8px;
    }

    .rental-application-section .form-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    /* Keep form-row-2 side-by-side on mobile */
    .rental-application-section .form-row-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .rental-application-section .form-row-2 > .form-group {
        min-width: 0;
    }

    .rental-application-section .form-group {
        margin-bottom: 10px;
    }

    .rental-application-section .form-group label {
        font-size: 0.85rem;
        margin-bottom: 3px;
    }

    .rental-application-section .form-group input,
    .rental-application-section .form-group select,
    .rental-application-section .form-group textarea {
        padding: 9px 10px;
        font-size: 0.85rem;
    }

    .radio-group, .checkbox-group {
        gap: 8px;
    }

    .radio-label, .checkbox-label {
        padding: 8px 12px;
        font-size: 0.85rem;
        gap: 6px;
    }

    .radio-group-compact, .checkbox-group-compact {
        gap: 6px;
    }

    .radio-group-compact .radio-label,
    .radio-group-compact .checkbox-label,
    .checkbox-group-compact .radio-label,
    .checkbox-group-compact .checkbox-label {
        padding: 5px 8px;
        font-size: 0.8rem;
    }

    .occupant-row {
        grid-template-columns: 1fr 80px;
        gap: 6px;
    }

    .terms-content {
        padding: 12px;
        font-size: 0.8rem;
    }

    .toggle-section {
        padding: 10px;
    }

    #consentVerificationSection {
        padding: 12px;
    }

    .signature-pad-wrapper canvas {
        height: 160px;
    }
}
