/**
 * File: assets/css/form-styles.css
 * Form styling for submissions and login forms
 * Updated for Orange (#f38221) & Purple (#181743) Theme
 */

/* Base Form Styles */
.as-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.as-form {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.as-form-header {
    text-align: center;
    margin-bottom: 32px;
}

.as-form-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 12px 0;
    line-height: 1.2;
}

.as-form-header p {
    font-size: 16px;
    color: #646970;
    margin: 0;
    line-height: 1.5;
}

/* Styled Form (Popup Version) */
.as-styled-form-container {
    max-width: 520px;
    margin: 0 auto;
    padding: 40px 32px;
    background: linear-gradient(135deg, #181743 0%, #2d1b69 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(24, 23, 67, 0.3);
    color: white;
    position: relative;
    overflow: hidden;
}

.as-styled-form-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: as-form-glow 8s linear infinite;
}

@keyframes as-form-glow {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
}

.as-styled-form-container .as-form-header {
    position: relative;
    z-index: 1;
}

.as-styled-form-container .as-form-header h2 {
    font-size: 32px;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 16px;
}

.as-styled-form-container .as-form-header p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* Form Structure */
.as-styled-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.as-form-row {
    display: flex;
    gap: 16px;
}

.as-form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Labels */
.as-form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: #1d2327;
    transition: color 0.3s ease;
}

.as-styled-form-container .as-form-group label {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Input Fields */
.as-form-group input,
.as-form-group textarea {
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    color: #1d2327;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-sizing: border-box;
    width: 100%;
}

.as-form-group input:focus,
.as-form-group textarea:focus {
    outline: none;
    border-color: #f38221;
    box-shadow: 0 0 0 4px rgba(243, 130, 33, 0.1);
    transform: translateY(-2px);
}

.as-form-group input::placeholder,
.as-form-group textarea::placeholder {
    color: #8c8f94;
    opacity: 1;
}

/* Styled Form Inputs */
.as-styled-form-container .as-form-group input,
.as-styled-form-container .as-form-group textarea {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
}

.as-styled-form-container .as-form-group input:focus,
.as-styled-form-container .as-form-group textarea:focus {
    border-color: rgba(243, 130, 33, 0.6);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 4px rgba(243, 130, 33, 0.1);
}

.as-styled-form-container .as-form-group input::placeholder,
.as-styled-form-container .as-form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Textarea Specific */
.as-form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

/* Word Counter */
.as-word-counter {
    margin-top: 6px;
    font-size: 12px;
    color: #646970;
    text-align: right;
    font-weight: 500;
}

.as-styled-form-container .as-word-counter {
    color: rgba(255, 255, 255, 0.8);
}

.as-word-counter.over-limit {
    color: #d63638;
    font-weight: 600;
}

.as-styled-form-container .as-word-counter.over-limit {
    color: #ff9999;
}

/* File Upload */
.as-file-upload {
    position: relative;
    cursor: pointer;
}

.as-file-upload input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.as-file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    border: 2px dashed #c3c4c7;
    border-radius: 10px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 60px;
}

.as-file-upload-label:hover {
    border-color: #f38221;
    background: rgba(243, 130, 33, 0.05);
    transform: translateY(-2px);
}

.as-file-upload-label i {
    font-size: 24px;
    color: #646970;
    transition: color 0.3s ease;
}

.as-file-upload-label:hover i {
    color: #f38221;
}

.as-file-upload-label span {
    font-size: 16px;
    font-weight: 500;
    color: #646970;
    transition: color 0.3s ease;
}

.as-file-upload-label:hover span {
    color: #f38221;
}

/* Styled Form File Upload */
.as-styled-form-container .as-file-upload-label {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.as-styled-form-container .as-file-upload-label:hover {
    border-color: rgba(243, 130, 33, 0.6);
    background: rgba(243, 130, 33, 0.15);
}

.as-styled-form-container .as-file-upload-label i,
.as-styled-form-container .as-file-upload-label span {
    color: white;
}

.as-file-requirements {
    margin-top: 8px;
    font-size: 12px;
    color: #8c8f94;
    text-align: center;
    line-height: 1.4;
}

.as-styled-form-container .as-file-requirements {
    color: rgba(255, 255, 255, 0.7);
}

.as-file-selected {
    background: rgba(243, 130, 33, 0.1) !important;
    border-color: #f38221 !important;
}

.as-styled-form-container .as-file-selected {
    background: rgba(243, 130, 33, 0.2) !important;
    border-color: rgba(243, 130, 33, 0.6) !important;
}

/* Submit Buttons */
.as-submit-btn {
    background: linear-gradient(135deg, #f38221 0%, #ff9642 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.as-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.as-submit-btn:hover::before {
    left: 100%;
}

.as-submit-btn:hover {
    background: linear-gradient(135deg, #ff9642 0%, #f38221 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(243, 130, 33, 0.4);
}

.as-submit-btn:active {
    transform: translateY(-1px);
}

.as-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.as-submit-btn i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.as-submit-btn:hover i {
    transform: scale(1.1);
}

/* Login Forms */
.as-login-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 40px 32px;
    background: linear-gradient(135deg, #181743 0%, #2d1b69 100%);
    border-radius: 16px;
    box-shadow: 0 16px 50px rgba(24, 23, 67, 0.3);
    color: white;
}

.as-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.as-login-header h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.as-login-header p {
    font-size: 16px;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.as-login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.as-login-form input[type="text"],
.as-login-form input[type="password"],
.as-login-form input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
}

.as-login-form input[type="text"]:focus,
.as-login-form input[type="password"]:focus,
.as-login-form input[type="email"]:focus {
    outline: none;
    border-color: rgba(243, 130, 33, 0.6);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 4px rgba(243, 130, 33, 0.1);
}

.as-login-form input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.as-login-form input[type="submit"] {
    width: 100%;
    background: linear-gradient(135deg, #f38221 0%, #ff9642 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.as-login-form input[type="submit"]:hover {
    background: linear-gradient(135deg, #ff9642 0%, #f38221 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(243, 130, 33, 0.4);
}

.as-login-form input[type="submit"]:active {
    transform: translateY(0);
}

.as-register-link {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.as-register-link p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.as-register-link a {
    color: #f38221;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.as-register-link a:hover {
    color: #ff9642;
    text-decoration: underline;
}

/* Validation States */
.as-form-group.has-error input,
.as-form-group.has-error textarea {
    border-color: #d63638;
    box-shadow: 0 0 0 4px rgba(214, 54, 56, 0.1);
}

.as-form-group.has-error label {
    color: #d63638;
}

.as-form-group.has-success input,
.as-form-group.has-success textarea {
    border-color: #f38221;
    box-shadow: 0 0 0 4px rgba(243, 130, 33, 0.1);
}

.as-form-group.has-success label {
    color: #f38221;
}

.as-form-group.focused label {
    color: #f38221;
}

.as-styled-form-container .as-form-group.focused label {
    color: #f38221;
}

.as-field-error {
    margin-top: 6px;
    font-size: 12px;
    color: #d63638;
    font-weight: 500;
}

.as-styled-form-container .as-field-error {
    color: #ffcccc;
}

/* Loading State */
.as-form-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.as-form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #f38221;
    border-radius: 50%;
    animation: as-spin 1s linear infinite;
    z-index: 10;
}

/* Success Messages */
.as-form-success {
    background: linear-gradient(135deg, #f38221 0%, #ff9642 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(243, 130, 33, 0.3);
}

.as-form-success i {
    margin-right: 12px;
    font-size: 20px;
}

.as-close-button {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.as-close-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Checkbox and Radio Styles */
.as-checkbox-group,
.as-radio-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
}

.as-checkbox-group input[type="checkbox"],
.as-radio-group input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #f38221;
    cursor: pointer;
}

.as-checkbox-group label,
.as-radio-group label {
    cursor: pointer;
    font-size: 14px;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .as-form-container,
    .as-styled-form-container,
    .as-login-container {
        padding: 24px 20px;
        margin: 16px;
        border-radius: 12px;
    }
    
    .as-form-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .as-form-header h2,
    .as-styled-form-container .as-form-header h2 {
        font-size: 24px;
    }
    
    .as-form-header p,
    .as-styled-form-container .as-form-header p {
        font-size: 15px;
    }
    
    .as-login-header h3 {
        font-size: 24px;
    }
    
    .as-submit-btn {
        padding: 14px 24px;
        font-size: 15px;
    }
    
    .as-file-upload-label {
        padding: 16px;
        min-height: 50px;
    }
    
    .as-file-upload-label i {
        font-size: 20px;
    }
    
    .as-file-upload-label span {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .as-form-container,
    .as-styled-form-container,
    .as-login-container {
        padding: 20px 16px;
        margin: 12px;
        border-radius: 10px;
    }
    
    .as-styled-form {
        gap: 20px;
    }
    
    .as-form-group input,
    .as-form-group textarea {
        padding: 12px 14px;
        font-size: 15px;
    }
    
    .as-form-group textarea {
        min-height: 100px;
    }
    
    .as-file-upload-label {
        flex-direction: column;
        padding: 14px;
        gap: 8px;
    }
    
    .as-submit-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .as-form-success {
        padding: 12px 16px;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .as-form-group input,
    .as-form-group textarea {
        border-width: 3px;
    }
    
    .as-styled-form-container .as-form-group input,
    .as-styled-form-container .as-form-group textarea {
        background: rgba(255, 255, 255, 0.3);
        border-color: rgba(255, 255, 255, 0.5);
    }
    
    .as-file-upload-label {
        border-width: 3px;
    }
    
    .as-submit-btn {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .as-submit-btn:hover,
    .as-form-group input:focus,
    .as-form-group textarea:focus,
    .as-file-upload-label:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .as-styled-form-container,
    .as-login-container {
        background: white;
        color: black;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .as-submit-btn,
    .as-close-button {
        display: none;
    }
    
    .as-form-group input,
    .as-form-group textarea {
        border: 1px solid #000;
        background: white;
        color: black;
    }
    
    .as-file-upload-label {
        border: 1px solid #000;
        background: white;
    }
}