/**
 * EI Trainer Profiles - Form Styles
 */

/* Form Layout */
.ei-form {
    max-width: 800px;
}

.ei-form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--ei-border);
}

.ei-form-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ei-teal);
    margin: 0 0 1rem 0;
}

.ei-form-row {
    margin-bottom: 1.5rem;
}

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

@media (max-width: 500px) {
    .ei-form-row--inline {
        grid-template-columns: 1fr;
    }
}

.ei-form-row label {
    display: block;
    font-weight: 500;
    color: var(--ei-text);
    margin-bottom: 0.5rem;
}

.ei-form-actions {
    margin-top: 2rem;
    text-align: center;
}

.ei-form-note {
    font-size: 0.875rem;
    color: var(--ei-text-light);
    margin-top: 0.5rem;
}

/* Input Styles */
.ei-input,
.ei-textarea,
.ei-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--ei-border);
    border-radius: var(--ei-radius);
    background: var(--ei-white);
    color: var(--ei-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ei-input:focus,
.ei-textarea:focus,
.ei-select:focus {
    outline: none;
    border-color: var(--ei-teal);
    box-shadow: 0 0 0 3px rgba(0, 102, 102, 0.1);
}

.ei-input::placeholder,
.ei-textarea::placeholder {
    color: var(--ei-text-light);
}

.ei-textarea {
    resize: vertical;
    min-height: 120px;
}

.ei-select {
    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='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Number input with prefix */
.ei-number-wrapper {
    display: flex;
    align-items: stretch;
}

.ei-number-prefix {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: var(--ei-cream);
    border: 1px solid var(--ei-border);
    border-right: none;
    border-radius: var(--ei-radius) 0 0 var(--ei-radius);
    color: var(--ei-text);
    font-weight: 500;
}

.ei-number-wrapper .ei-input {
    border-radius: 0 var(--ei-radius) var(--ei-radius) 0;
}

/* Character counter */
.ei-char-count {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    color: var(--ei-text-light);
    margin-top: 0.25rem;
}

/* Checkbox/Radio Groups */
.ei-checkbox-group,
.ei-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ei-checkbox-group--compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.ei-checkbox-label,
.ei-radio-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.ei-checkbox-label:hover,
.ei-radio-label:hover {
    background: var(--ei-cream);
}

.ei-checkbox-label input,
.ei-radio-label input {
    margin-top: 0.2rem;
    accent-color: var(--ei-teal);
}

.ei-checkbox-label span,
.ei-radio-label span {
    flex: 1;
}

/* Field guidance */
.ei-field-guidance {
    font-size: 0.875rem;
    color: var(--ei-text-light);
    margin: 0.25rem 0 0.5rem 0;
    line-height: 1.4;
}

/* Image Upload */
.ei-image-upload {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.ei-image-preview {
    width: 100px;
    height: 100px;
    border-radius: var(--ei-radius);
    background: var(--ei-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px dashed var(--ei-border);
}

.ei-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ei-image-upload--small .ei-image-preview {
    width: 60px;
    height: 60px;
}

/* Repeater Fields */
.ei-repeater,
.ei-repeater-complex {
    border: 1px solid var(--ei-border);
    border-radius: var(--ei-radius);
    padding: 1rem;
    background: #fafafa;
}

.ei-repeater-items {
    margin-bottom: 1rem;
}

.ei-repeater-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.ei-repeater-item .ei-input {
    flex: 1;
}

.ei-repeater-item--complex {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: var(--ei-white);
    border-radius: var(--ei-radius);
    border: 1px solid var(--ei-border);
    position: relative;
}

.ei-repeater-item--complex .ei-subfield {
    margin-bottom: 0.75rem;
}

.ei-repeater-item--complex .ei-subfield:last-of-type {
    margin-bottom: 0;
}

.ei-repeater-item--complex .ei-subfield label {
    font-size: 0.875rem;
    font-weight: 500;
}

.ei-repeater-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: #ffebee;
    color: var(--ei-error);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.ei-repeater-remove:hover {
    background: #ffcdd2;
}

.ei-repeater-item--complex .ei-repeater-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.ei-repeater-add {
    width: 100%;
}

/* Multi-step Form */
.ei-multistep-form {
    position: relative;
}

.ei-form-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.ei-form-progress::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--ei-border);
    z-index: 0;
}

.ei-form-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.ei-form-step__number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ei-white);
    border: 2px solid var(--ei-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--ei-text-light);
    margin-bottom: 0.5rem;
}

.ei-form-step--active .ei-form-step__number {
    background: var(--ei-teal);
    border-color: var(--ei-teal);
    color: var(--ei-white);
}

.ei-form-step--complete .ei-form-step__number {
    background: var(--ei-success);
    border-color: var(--ei-success);
    color: var(--ei-white);
}

.ei-form-step__label {
    font-size: 0.75rem;
    color: var(--ei-text-light);
    text-align: center;
    max-width: 80px;
}

.ei-form-step--active .ei-form-step__label {
    color: var(--ei-teal);
    font-weight: 500;
}

/* Form Section Panels */
.ei-form-panel {
    display: none;
}

.ei-form-panel--active {
    display: block;
}

.ei-form-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ei-border);
}

/* Field wrapper */
.ei-field {
    margin-bottom: 1.5rem;
}

.ei-field > label {
    display: block;
    font-weight: 500;
    color: var(--ei-text);
    margin-bottom: 0.5rem;
}

/* Login required message */
.ei-login-required,
.ei-access-denied {
    padding: 2rem;
    text-align: center;
    background: var(--ei-cream);
    border-radius: var(--ei-radius);
    color: var(--ei-text);
}

/* Help Link Styles */
.ei-field-help-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--ei-teal-light, #e6f2f2);
    color: var(--ei-teal, #005959);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--ei-radius-sm, 6px);
    transition: all 0.2s;
}

.ei-field-help-link:hover {
    background: var(--ei-teal, #005959);
    color: #fff;
}

.ei-help-icon {
    font-size: 1rem;
}

/* Important Field Notice */
.ei-important-field-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left: 4px solid #ff9800;
    border-radius: 0 var(--ei-radius-sm, 6px) var(--ei-radius-sm, 6px) 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: #e65100;
}

.ei-important-icon {
    font-size: 1.25rem;
}

/* Field with important flag */
.ei-field--url .ei-input {
    border-width: 2px;
}

.ei-field--url .ei-input:focus {
    border-color: var(--ei-teal, #005959);
    box-shadow: 0 0 0 3px rgba(0, 89, 89, 0.15);
}
