/**
 * Form Frontend Styles
 * 
 * Clean, modern styling for forms on the frontend
 */

/* ===================================
   Form Wrapper
   =================================== */
.lg-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
}

.lg-form {
    width: 100%;
}

/* ===================================
   Form Fields
   =================================== */
.lg-form-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.lg-form-field {
    width: 100%;
}

.lg-field-width-100 {
    width: 100%;
}

.lg-field-width-75 {
    width: calc(75% - 10px);
}

.lg-field-width-50 {
    width: calc(50% - 10px);
}

.lg-field-width-33 {
    width: calc(33.333% - 14px);
}

.lg-field-width-25 {
    width: calc(25% - 15px);
}

/* ===================================
   Labels
   =================================== */
.lg-field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #1e293b;
}

.lg-required-star {
    color: #dc2626;
    margin-right: 4px;
}

/* ===================================
   Inputs
   =================================== */
.lg-field-input,
.lg-field-textarea,
.lg-field-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: #1e293b;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.lg-field-input:focus,
.lg-field-textarea:focus,
.lg-field-select:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.lg-field-input.lg-field-invalid,
.lg-field-textarea.lg-field-invalid,
.lg-field-select.lg-field-invalid {
    border-color: #dc2626;
    background-color: #fef2f2;
}

.lg-field-input.lg-field-invalid:focus,
.lg-field-textarea.lg-field-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.lg-field-input::placeholder,
.lg-field-textarea::placeholder {
    color: #94a3b8;
}

.lg-field-textarea {
    min-height: 120px;
    resize: vertical;
}

.lg-field-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 40px;
}

/* ===================================
   Radio & Checkbox
   =================================== */
.lg-field-radio-group,
.lg-field-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lg-radio-option,
.lg-checkbox-option,
.lg-checkbox-single {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
}

.lg-radio-option input,
.lg-checkbox-option input,
.lg-checkbox-single input {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    cursor: pointer;
}

/* ===================================
   Error Messages
   =================================== */
.lg-field-error {
    margin-top: 6px;
    font-size: 13px;
    color: #dc2626;
}

/* ===================================
   Submit Button
   =================================== */
.lg-form-submit {
    margin-top: 24px;
}

.lg-form-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.lg-form-button:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.lg-form-button:active {
    transform: translateY(0);
}

.lg-form-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ===================================
   Messages
   =================================== */
.lg-form-messages {
    margin-top: 20px;
}

.lg-form-success {
    padding: 16px 20px;
    background: #dcfce7;
    color: #166534;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.lg-form-error:not(:empty) {
    padding: 16px 20px;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

/* ===================================
   Honeypot (hidden from users)
   =================================== */
.lg-form-hp {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {

    .lg-field-width-75,
    .lg-field-width-50,
    .lg-field-width-33,
    .lg-field-width-25 {
        width: 100%;
    }

    .lg-field-input,
    .lg-field-textarea,
    .lg-field-select {
        padding: 14px 16px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .lg-form-button {
        padding: 16px;
    }
}

/* ===================================
   RTL Support
   =================================== */
[dir="rtl"] .lg-form-wrapper,
.rtl .lg-form-wrapper {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .lg-field-select,
.rtl .lg-field-select {
    background-position: right 12px center;
    padding-right: 40px;
    padding-left: 16px;
}

[dir="rtl"] .lg-required-star,
.rtl .lg-required-star {
    margin-right: 0;
    margin-left: 4px;
}