/* Supplier Frontend Form Styles */

.supplier-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.supplier-form {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.supplier-form-title {
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #2271b1;
    color: #1d2327;
    font-size: 1.5em;
}

/* Grid Layout */
.supplier-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field-wide {
    grid-column: span 2;
}

.form-field-full {
    grid-column: span 3;
}

/* Labels */
.form-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.form-field .required {
    color: #d63638;
}

/* Inputs */
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="url"],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.form-field input:invalid:not(:placeholder-shown),
.form-field select:invalid:not([value=""]),
.form-field textarea:invalid:not(:placeholder-shown) {
    border-color: #d63638;
}

.form-field textarea {
    resize: vertical;
    min-height: 80px;
}

/* Hidden other input */
.hidden-other-input {
    display: none;
    margin-top: 10px;
}

.hidden-other-input.visible {
    display: block;
}

/* Submit Button */
.form-submit {
    margin-top: 30px;
    text-align: center;
}

.supplier-form-submit {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.supplier-form-submit:hover {
    background: #135e96;
}

.supplier-form-submit:disabled {
    background: #a7aaad;
    cursor: not-allowed;
}

.supplier-form-submit.loading {
    position: relative;
    color: transparent;
}

.supplier-form-submit.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Messages */
.form-messages {
    margin-top: 20px;
}

.form-message {
    padding: 15px 20px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.form-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    animation: slideIn 0.4s ease-out;
}

.form-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    animation: slideIn 0.4s ease-out;
}

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

/* Responsive */
@media (max-width: 768px) {
    .supplier-form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-field-wide {
        grid-column: span 2;
    }
    
    .form-field-full {
        grid-column: span 2;
    }
    
    .supplier-form {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .supplier-form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-field-wide,
    .form-field-full {
        grid-column: span 1;
    }
    
    .supplier-form-wrapper {
        padding: 10px;
    }
    
    .supplier-form {
        padding: 15px;
    }
    
    .supplier-form-submit {
        width: 100%;
    }
}

/* RTL Adjustments */
[dir="rtl"] .supplier-form-wrapper {
    text-align: right;
}

[dir="rtl"] .form-field input,
[dir="rtl"] .form-field select,
[dir="rtl"] .form-field textarea {
    text-align: right;
}
