/**
 * Repair Request Form - Mobile-First Styling
 * Clean, accessible, low-friction design
 */

/* Container */
.repair-request-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8f5e9 100%);
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

@media (max-width: 480px) {
    .repair-request-wrapper {
        padding: 0.75rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

.repair-request-container {
    width: 100%;
    max-width: 600px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    margin: 0 auto;
}

@media (max-width: 480px) {
    .repair-request-container {
        padding: 1rem;
        border-radius: 12px;
    }
}

/* Header */
.repair-request-header {
    text-align: center;
    margin-bottom: 2rem;
}

.repair-request-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #009B4D, #00796b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: #ffffff;
    font-size: 1.5rem;
}

.repair-request-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.repair-request-header p {
    font-size: 1rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* Form Sections */
.form-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: visible;
}

.form-section:last-of-type {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e8f5e9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: #009B4D;
    border-radius: 2px;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group:last-child {
    margin-bottom: 0;
}

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

.form-label .required {
    color: #d32f2f;
    font-weight: 700;
}

.form-label .optional {
    color: #999;
    font-weight: 400;
    font-size: 0.85rem;
}

/* Form Inputs */
.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    color: #333;
    background: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: #009B4D;
    box-shadow: 0 0 0 3px rgba(0, 155, 77, 0.1);
}

.form-input::placeholder {
    color: #aaa;
}

.form-input.error {
    border-color: #e57373;
    background: #ffebee;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(229, 115, 115, 0.1);
}

/* Select Dropdown */
select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

select.form-input::-ms-expand {
    display: none;
}

/* iOS Safari specific fixes */
select.form-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Textarea */
.form-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* Form Hints */
.form-hint {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.375rem;
}

/* Form Errors */
.form-error {
    display: none;
    font-size: 0.875rem;
    color: #e57373;
    margin-top: 0.5rem;
    font-weight: 400;
    line-height: 1.4;
}

/* Add Another Issue Button */
.add-issue-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #f0f9f4;
    border: 2px dashed #009B4D;
    border-radius: 10px;
    color: #009B4D;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.add-issue-btn:hover {
    background: #e8f5e9;
    border-style: solid;
    transform: translateY(-1px);
}

.add-issue-btn:active {
    transform: translateY(0);
}

.add-issue-btn i {
    font-size: 1.1rem;
}

/* Additional Issue Item */
.additional-issue-item {
    padding: 1.25rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 1rem;
    position: relative;
}

.additional-issue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.additional-issue-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.additional-issue-label i {
    color: #009B4D;
}

.remove-issue-btn {
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #666;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.remove-issue-btn:hover {
    background: #ffebee;
    border-color: #e57373;
    color: #d32f2f;
}

.remove-issue-btn i {
    font-size: 0.9rem;
}

/* Model Helper Button */
.model-helper-btn {
    min-width: 48px;
    height: auto;
    padding: 0.875rem 1rem;
    background: #f5f5f5;
    border: 1px solid #d0d0d0;
    border-radius: 10px;
    color: #666;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: stretch;
}

@media (max-width: 480px) {
    .model-helper-btn {
        padding: 0.75rem 0.875rem;
        font-size: 0.95rem;
    }
}

.model-helper-btn:hover {
    background: #e8e8e8;
    border-color: #999;
    color: #333;
    transform: none;
}

.model-helper-btn:active {
    transform: scale(0.98);
}

/* Model Helper Modal */
.model-helper-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.model-helper-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.model-helper-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.model-helper-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    color: #666;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.model-helper-close:hover {
    background: #e0e0e0;
    color: #333;
}

.model-helper-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e8f5e9;
}

.model-helper-header i {
    font-size: 2rem;
    color: #009B4D;
}

.model-helper-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.model-helper-body {
    color: #333;
    line-height: 1.6;
}

.model-helper-body h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 1rem;
}

.model-helper-body ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

.model-helper-body ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.model-helper-body li {
    margin: 0.5rem 0;
}

.model-helper-body strong {
    color: #009B4D;
    font-weight: 600;
}

.model-helper-body p {
    margin: 1rem 0;
}

/* Form Actions */
.form-actions {
    margin-top: 3rem;
    padding: 2rem 1.5rem;
    text-align: center;
    background: linear-gradient(to bottom, transparent, #f8fdf9);
    border-radius: 12px;
    position: relative;
}

.form-actions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(to right, transparent, #e8f5e9, transparent);
}

/* Reassurance Copy */
.form-reassurance {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: #f0f9f4;
    border: 2px solid #d4edda;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: #155724;
    font-weight: 500;
    line-height: 1.5;
}

.form-reassurance i {
    font-size: 1.25rem;
    color: #009B4D;
    flex-shrink: 0;
}

.submit-btn {
    width: 100%;
    padding: 1.125rem 2rem;
    background: linear-gradient(135deg, #009B4D, #00796b);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 155, 77, 0.25);
    position: relative;
    overflow: hidden;
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.submit-btn:hover::after {
    width: 300px;
    height: 300px;
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #00873f, #00695c);
    box-shadow: 0 8px 24px rgba(0, 155, 77, 0.35);
    transform: translateY(-2px);
}

.submit-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.submit-btn:disabled:hover {
    background: #cccccc;
    transform: none;
}

.submit-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 155, 77, 0.3);
}

.form-footer-text {
    font-size: 0.875rem;
    color: #666;
    margin: 1.25rem 0 0;
    line-height: 1.6;
    text-align: center;
}

.form-footer-text i {
    margin-right: 0.25rem;
}

/* Success State */
.success-state {
    text-align: center;
    padding: 2rem 1rem;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #009B4D, #00c853);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    color: #ffffff;
    animation: success-pop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes success-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-state h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 1rem;
    line-height: 1.3;
}

.success-state p {
    font-size: 1rem;
    color: #666;
    margin: 0 0 2rem;
    line-height: 1.6;
}

.success-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.success-btn {
    padding: 0.875rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    font-family: inherit;
    border: none;
}

.success-btn.primary {
    background: #009B4D;
    color: #ffffff;
}

.success-btn.primary:hover {
    background: #00873f;
    transform: translateY(-1px);
}

.success-btn.secondary {
    background: #f5f5f5;
    color: #333;
    border: 2px solid #e0e0e0;
}

.success-btn.secondary:hover {
    background: #e8e8e8;
}

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

.form-group {
    animation: fadeIn 0.3s ease;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .repair-request-wrapper {
        padding: 2rem;
        align-items: center;
    }

    .repair-request-container {
        padding: 2.5rem;
    }

    .repair-request-header h1 {
        font-size: 2rem;
    }

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

    .form-section {
        padding: 2rem;
    }
    
    .form-input {
        font-size: 1rem;
    }

    .form-actions {
        padding: 2.5rem 2rem;
    }

    .success-actions {
        flex-direction: row;
        justify-content: center;
    }

    .success-btn {
        min-width: 180px;
    }

    .model-helper-content {
        padding: 2.5rem;
    }
}

/* Large Desktop */
@media (min-width: 1024px) {
    .repair-request-container {
        max-width: 650px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .form-input {
        border-width: 3px;
    }

    .form-input:focus {
        outline: 3px solid #009B4D;
        outline-offset: 2px;
    }
}

/* Touch Targets (minimum 44x44px for accessibility) */
@media (pointer: coarse) {
    .form-input,
    .submit-btn,
    .model-helper-btn {
        min-height: 48px;
    }
    
    select.form-input {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

/* Mobile-specific improvements */
@media (max-width: 480px) {
    .form-input {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 1rem;
    }
    
    select.form-input {
        padding-right: 2.5rem;
        background-position: right 0.75rem center;
    }
    
    .form-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .add-issue-btn {
        width: 100%;
        justify-content: center;
    }
    
    .additional-issue-item {
        padding: 1rem;
    }
    
    .additional-issue-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .remove-issue-btn {
        align-self: flex-end;
    }
}

/* Loading State */
.submit-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Focus Visible (keyboard navigation) */
.form-input:focus-visible,
.submit-btn:focus-visible,
.model-helper-btn:focus-visible {
    outline: 3px solid #009B4D;
    outline-offset: 2px;
}

/* Exit Intent Modal (Desktop Only) */
.exit-intent-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.exit-intent-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.exit-intent-content {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.exit-intent-text {
    font-size: 1.125rem;
    color: #333;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.exit-intent-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.exit-intent-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.exit-intent-btn.primary {
    background: #009B4D;
    color: #ffffff;
}

.exit-intent-btn.primary:hover {
    background: #00873f;
}

.exit-intent-btn.secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
}

.exit-intent-btn.secondary:hover {
    background: #e8e8e8;
}

/* Mobile Modal Adjustments */
@media (max-width: 768px) {
    .model-helper-content {
        padding: 1.5rem;
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .model-helper-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .model-helper-header h3 {
        font-size: 1.25rem;
    }

    /* Hide exit intent on mobile */
    .exit-intent-modal {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .model-helper-content {
        padding: 1.25rem;
        max-height: 90vh;
    }
    
    .model-helper-header h3 {
        font-size: 1.125rem;
    }
    
    .model-helper-body {
        font-size: 0.95rem;
    }
}
