/**
 * Portal Forms - Enhanced Contrast & Visibility
 * 
 * @package RivaClientPortal
 * @version 1.0.1
 */

/* Form Groups */
.rcp-form-group {
    margin-bottom: var(--rcp-space-5);
}

.rcp-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--rcp-space-2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.rcp-form-label--required::after {
    content: '*';
    color: #ff4444;
    margin-left: 4px;
}

/* Text Inputs */
.rcp-form-control,
.rcp-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    font-family: var(--rcp-font-family);
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--rcp-radius-lg);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    -webkit-text-fill-color: #ffffff;
}

.rcp-form-control::placeholder,
.rcp-input::placeholder,
input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
    opacity: 1;
}

.rcp-form-control:focus,
.rcp-input:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(10, 132, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
    color: #ffffff !important;
}

/* Date Input Enhanced Styling */
input[type="date"] {
    position: relative;
    padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' stroke='%23ffffff' stroke-width='2' stroke-opacity='0.6'/%3E%3Cline x1='16' y1='2' x2='16' y2='6' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-opacity='0.6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-opacity='0.6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10' stroke='%23ffffff' stroke-width='2' stroke-opacity='0.6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 14px;
    width: 18px;
    height: 18px;
    opacity: 0;
    cursor: pointer;
}

input[type="date"]::-webkit-datetime-edit {
    color: #ffffff;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    color: #ffffff;
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-clear-button {
    display: none;
}

/* Select Dropdown */
select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-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='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

select option {
    background: #1a1a1a;
    color: #ffffff;
    padding: 8px;
}

/* Textarea */
textarea {
    min-height: 120px;
    resize: vertical;
}

/* File Input */
input[type="file"] {
    padding: 10px;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    padding: 8px 16px;
    background: rgba(10, 132, 255, 0.2);
    border: 1px solid rgba(10, 132, 255, 0.4);
    border-radius: 8px;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.3s ease;
}

input[type="file"]::file-selector-button:hover {
    background: rgba(10, 132, 255, 0.3);
    border-color: rgba(10, 132, 255, 0.6);
}

/* Checkbox & Radio */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

.rcp-checkbox-label,
.rcp-radio-label {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    user-select: none;
}

/* Form Validation */
.rcp-form-control.error,
.rcp-input.error,
input.error {
    border-color: #ff4444;
    background: rgba(255, 68, 68, 0.1) !important;
}

.rcp-form-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #ff6b6b;
    font-weight: 500;
}

.rcp-form-control.success,
.rcp-input.success,
input.success {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.1) !important;
}

/* Disabled State */
.rcp-form-control:disabled,
.rcp-input:disabled,
input:disabled,
textarea:disabled,
select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.03) !important;
}

/* Form Buttons */
.rcp-form-actions {
    display: flex;
    gap: var(--rcp-space-3);
    margin-top: var(--rcp-space-6);
    flex-wrap: wrap;
}

.rcp-btn-submit,
.rcp-btn-primary {
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #0a84ff, #5e5ce6);
    border: none;
    border-radius: var(--rcp-radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3);
}

.rcp-btn-submit:hover,
.rcp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(10, 132, 255, 0.4);
}

.rcp-btn-submit:active,
.rcp-btn-primary:active {
    transform: translateY(0);
}

.rcp-btn-secondary {
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--rcp-radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.rcp-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Form Help Text */
.rcp-form-help {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 768px) {
    .rcp-form-control,
    .rcp-input,
    input,
    textarea,
    select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .rcp-form-actions {
        flex-direction: column;
    }
    
    .rcp-btn-submit,
    .rcp-btn-primary,
    .rcp-btn-secondary {
        width: 100%;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .rcp-form-control,
    .rcp-input,
    input,
    textarea,
    select {
        border-width: 2px;
        background: rgba(255, 255, 255, 0.15) !important;
    }
    
    .rcp-form-label {
        color: #ffffff;
        font-weight: 700;
    }
}

