/* ClientPlaza Responsive Forms CSS */
/* Mobile-first form design replacing fixed-width form layouts */

/* ==========================================================================
   BASE FORM STYLES - RESPONSIVE
   ========================================================================== */

form {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   FORM CONTAINERS - RESPONSIVE REPLACEMENTS
   ========================================================================== */

/* Modern replacement for #LoginIndex */
.form-container,
#LoginIndex,
#LoginIndex2 {
    width: 100%;
    max-width: 500px;
    margin: 1rem auto;
    padding: 1.5rem;
    background: linear-gradient(135deg, #004aa1, #0066cc);
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

@media (min-width: 768px) {
    .form-container,
    #LoginIndex,
    #LoginIndex2 {
        padding: 2rem;
        max-width: 600px;
    }
}

/* Two-step form containers */
.form-step {
    width: 100%;
    margin: 1rem auto;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
}

.form-step.active {
    border-color: #0066cc;
}

/* ==========================================================================
   INPUT FIELDS - RESPONSIVE & TOUCH-FRIENDLY
   ========================================================================== */

input[type="text"],
input[type="email"], 
input[type="password"],
input[type="tel"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    margin: 0.5rem 0;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
    
    /* Touch-friendly sizing */
    min-height: 44px;
}

/* Focus states */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
    border-color: #0066cc;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    background-color: #fff;
}

/* Error states */
input[type="text"].error,
input[type="email"].error,
input[type="password"].error,
input[type="tel"].error,
input[type="url"].error,
select.error,
textarea.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* ==========================================================================
   PLACEHOLDER STYLING - RESPONSIVE
   ========================================================================== */

::-webkit-input-placeholder {
    font-size: 0.875rem;
    color: #6c757d;
    text-align: left;
    font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
    opacity: 1;
}

:-moz-placeholder {
    font-size: 0.875rem;
    color: #6c757d;
    font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
    text-align: left;
    opacity: 1;
}

::-moz-placeholder {
    font-size: 0.875rem;
    color: #6c757d;
    font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
    text-align: left;
    opacity: 1;
}

:-ms-input-placeholder {
    font-size: 0.875rem;
    color: #6c757d;
    font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
    text-align: left;
}

/* ==========================================================================
   TEXTAREA SPECIFIC STYLES
   ========================================================================== */

textarea {
    resize: vertical;
    min-height: 120px;
    font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
}

/* Service request textarea - larger for main content */
textarea[name="QRequest"],
textarea#QRequest {
    min-height: 150px;
    font-size: 1rem;
    line-height: 1.6;
}

@media (min-width: 768px) {
    textarea[name="QRequest"],
    textarea#QRequest {
        min-height: 180px;
    }
}

/* ==========================================================================
   FORM BUTTONS - RESPONSIVE & ACCESSIBLE
   ========================================================================== */

button,
input[type="submit"],
input[type="button"],
input[type="image"] {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    min-width: 120px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background: linear-gradient(135deg, #218838, #1ea080);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

button:active,
input[type="submit"]:active,
input[type="button"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.2);
}

button:focus,
input[type="submit"]:focus,
input[type="button"]:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Secondary button style */
.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268, #495057);
}

/* Danger button style */
.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
}

/* ==========================================================================
   FORM LABELS & FIELDSETS
   ========================================================================== */

label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

fieldset {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

legend {
    font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #0066cc;
    padding: 0 0.5rem;
}

/* ==========================================================================
   FORM LAYOUT HELPERS
   ========================================================================== */

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

@media (min-width: 768px) {
    .form-row.two-columns {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-row.three-columns {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group.inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ==========================================================================
   STEP INDICATORS FOR MULTI-STEP FORMS
   ========================================================================== */

.step-indicator {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
    gap: 1rem;
}

.step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
    position: relative;
}

.step.active {
    background: #0066cc;
    color: white;
}

.step.completed {
    background: #28a745;
    color: white;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 100%;
    width: 1rem;
    height: 2px;
    background: #e9ecef;
    transform: translateY(-50%);
}

.step.completed:not(:last-child)::after {
    background: #28a745;
}

/* ==========================================================================
   FORM VALIDATION MESSAGES
   ========================================================================== */

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
    font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
}

.success-message {
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
    font-family: "Century Gothic", "Trebuchet MS", Arial, sans-serif;
}

/* ==========================================================================
   RESPONSIVE TABLE-BASED FORMS (Legacy Support)
   ========================================================================== */

/* Convert legacy table-based forms to responsive */
table.form-table {
    width: 100%;
    border-collapse: collapse;
}

table.form-table td {
    padding: 0.5rem;
    vertical-align: top;
}

@media (max-width: 767px) {
    table.form-table,
    table.form-table tbody,
    table.form-table tr,
    table.form-table td {
        display: block;
        width: 100%;
    }
    
    table.form-table td {
        padding: 0.25rem 0;
        border: none;
    }
}

/* ==========================================================================
   FORM ACCESSIBILITY ENHANCEMENTS
   ========================================================================== */

/* Required field indicator */
.required::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

/* Form help text */
.form-help {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* Disabled form elements */
input:disabled,
textarea:disabled,
select:disabled,
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

/* ==========================================================================
   LOADING STATES FOR FORMS
   ========================================================================== */

.form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

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