/**
 * Enhanced Forms CSS
 * Professional forms styling for hosting company
 * Maintains existing design colors and fonts
 */

/* Form Container */
.form-container {
    max-width: 520px;
    margin: 0 auto;
    background: white;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(2, 6, 23, 0.08);
    padding: 40px;
}

/* Form Groups */
.form-group {
    margin-bottom: 24px;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* Form Labels */
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #0B3D91;
    font-size: 14px;
    line-height: 1.5;
}

.form-label .required {
    color: #dc2626;
    margin-inline-start: 4px;
}

/* Form Inputs */
.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
    background: #fff;
    color: #0f172a;
}

.form-input:focus {
    outline: none;
    border-color: #0B3D91;
    box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.1);
    background: #fff;
}

.form-input:hover:not(:focus) {
    border-color: #cbd5e1;
}

.form-input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

/* Input States */
.form-input:invalid:not(:placeholder-shown) {
    border-color: #dc2626;
}

.form-input:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

/* Input Icons */
.form-input-wrapper {
    position: relative;
}

.form-input-wrapper .input-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 16px;
    color: #94a3b8;
    pointer-events: none;
    font-size: 18px;
}

html[dir="rtl"] .form-input-wrapper .input-icon {
    left: auto;
    right: 16px;
}

.form-input-wrapper .form-input {
    padding-left: 48px;
}

html[dir="rtl"] .form-input-wrapper .form-input {
    padding-left: 16px;
    padding-right: 48px;
}

/* Form Textarea */
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
    background: #fff;
    color: #0f172a;
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.form-textarea:focus {
    outline: none;
    border-color: #0B3D91;
    box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.1);
}

.form-textarea:hover:not(:focus) {
    border-color: #cbd5e1;
}

/* Form Select */
.form-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    appearance: none;
    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='%230B3D91' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

html[dir="rtl"] .form-select {
    background-position: left 16px center;
    padding-right: 16px;
    padding-left: 40px;
}

.form-select:focus {
    outline: none;
    border-color: #0B3D91;
    box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.1);
}

.form-select:hover:not(:focus) {
    border-color: #cbd5e1;
}

/* Form Checkbox & Radio */
.form-checkbox,
.form-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    position: relative;
    flex-shrink: 0;
}

.form-radio {
    border-radius: 50%;
}

.form-checkbox:checked,
.form-radio:checked {
    background: #0B3D91;
    border-color: #0B3D91;
}

.form-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.form-radio:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.form-checkbox-label,
.form-radio-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #0f172a;
    user-select: none;
}

/* Form Help Text */
.form-help {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.form-help.error {
    color: #dc2626;
}

.form-help.success {
    color: #10b981;
}

/* Form Error Messages */
.form-error {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 10px 12px;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    font-size: 13px;
    border-left: 3px solid #dc2626;
}

.form-error-icon {
    flex-shrink: 0;
    font-size: 16px;
}

/* Form Success Messages */
.form-success {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding: 10px 12px;
    background: #d1fae5;
    color: #065f46;
    border-radius: 8px;
    font-size: 13px;
    border-left: 3px solid #10b981;
}

/* Form Buttons */
.form-submit {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    background: #0B3D91;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Cairo', sans-serif;
    position: relative;
    overflow: hidden;
}

.form-submit:hover:not(:disabled) {
    background: #0a2d6f;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(11, 61, 145, 0.25);
}

.form-submit:active:not(:disabled) {
    transform: translateY(0);
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-submit .btn-loading {
    display: none;
}

.form-submit.loading .btn-text {
    opacity: 0;
}

.form-submit.loading .btn-loading {
    display: inline-block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Loading Spinner */
.btn-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form Grid */
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s;
    border-radius: 2px;
}

.password-strength.weak .password-strength-bar {
    width: 33%;
    background: #dc2626;
}

.password-strength.medium .password-strength-bar {
    width: 66%;
    background: #f59e0b;
}

.password-strength.strong .password-strength-bar {
    width: 100%;
    background: #10b981;
}

/* Real-time Validation */
.form-input.validating {
    border-color: #f59e0b;
}

.form-input.valid {
    border-color: #10b981;
}

.form-input.invalid {
    border-color: #dc2626;
}

/* Responsive */
@media (max-width: 768px) {
    .form-container {
        padding: 32px 24px;
        border-radius: 16px;
    }
    
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 24px 20px;
    }
    
    .form-label {
        font-size: 13px;
    }
}

