/**
 * Reparation33 Attestation - Frontend Styles
 */

/* Form Wrapper */
.r33-attestation-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.r33-form-title {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

/* Form Sections */
.r33-form-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.r33-form-section h3 {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e74c3c;
    color: #333;
    font-size: 1.2em;
}

/* Form Rows */
.r33-form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
    margin-bottom: 15px;
}

.r33-form-row:last-child {
    margin-bottom: 0;
}

/* Form Fields */
.r33-form-field {
    padding: 0 10px;
    margin-bottom: 15px;
    flex: 1;
    min-width: 200px;
}

.r33-form-field-half {
    flex: 0 0 50%;
    max-width: 50%;
}

.r33-form-field-third {
    flex: 0 0 33.333%;
    max-width: 33.333%;
}

.r33-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.r33-form-field label .required {
    color: #e74c3c;
}

.r33-form-field input[type="text"],
.r33-form-field input[type="email"],
.r33-form-field input[type="tel"],
.r33-form-field input[type="date"],
.r33-form-field input[type="number"],
.r33-form-field select,
.r33-form-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.r33-form-field input:focus,
.r33-form-field select:focus,
.r33-form-field textarea:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

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

.r33-field-help {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}

/* Checkbox Field */
.r33-checkbox-field label {
    display: flex;
    align-items: flex-start;
    font-weight: normal;
    cursor: pointer;
}

.r33-checkbox-field input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Price Box */
.r33-price-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.r33-price-label {
    font-size: 18px;
    color: #333;
}

.r33-price-amount {
    font-size: 28px;
    font-weight: bold;
    color: #e74c3c;
}

/* Form Summary */
.r33-form-summary {
    background: #f8f9fa;
    border: 2px solid #e74c3c;
}

/* Form Actions */
.r33-form-actions {
    text-align: center;
    margin-top: 20px;
}

.r33-submit-btn {
    display: inline-block;
    padding: 15px 50px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.r33-submit-btn:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.r33-submit-btn:active {
    transform: translateY(0);
}

.r33-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

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

.r33-message {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.r33-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.r33-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Loading State */
.r33-attestation-form.r33-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.r33-attestation-form.r33-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #e74c3c;
    border-radius: 50%;
    animation: r33-spin 1s linear infinite;
}

@keyframes r33-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* My Attestations Table */
.r33-my-attestations {
    margin: 20px 0;
}

.r33-attestations-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.r33-attestations-table th,
.r33-attestations-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.r33-attestations-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.r33-attestations-table tr:last-child td {
    border-bottom: none;
}

.r33-attestations-table tr:hover {
    background: #f8f9fa;
}

/* Status Badges */
.r33-status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.r33-status-completed {
    background: #d4edda;
    color: #155724;
}

.r33-status-pending {
    background: #fff3cd;
    color: #856404;
}

/* Download Button */
.r33-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: #e74c3c;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: background 0.3s;
}

.r33-download-btn:hover {
    background: #c0392b;
    color: #fff;
}

.r33-pending-text {
    color: #856404;
    font-style: italic;
}

/* Thank You Message */
.r33-thankyou-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.r33-thankyou-message h3 {
    margin: 0 0 10px 0;
    color: #155724;
}

.r33-thankyou-message p {
    margin: 0;
    color: #155724;
}

/* Login Required */
.r33-login-required {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    text-align: center;
}

.r33-no-attestations {
    padding: 40px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .r33-form-field-half,
    .r33-form-field-third {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .r33-attestations-table {
        display: block;
    }
    
    .r33-attestations-table thead {
        display: none;
    }
    
    .r33-attestations-table tbody,
    .r33-attestations-table tr,
    .r33-attestations-table td {
        display: block;
    }
    
    .r33-attestations-table tr {
        margin-bottom: 15px;
        border: 1px solid #eee;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .r33-attestations-table td {
        padding: 10px 15px;
        text-align: right;
        border-bottom: 1px solid #eee;
    }
    
    .r33-attestations-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
    }
    
    .r33-attestations-table td:last-child {
        border-bottom: none;
    }
    
    .r33-price-box {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .r33-submit-btn {
        width: 100%;
        padding: 15px 20px;
    }
}
