/* ================================================
   Formular 230 – Frontend Styles
   Premium, modern design for Declaration 230 form
   ================================================ */

/* Google Font import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============ WRAPPER ============ */
.f230-form-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 780px;
    margin: 40px auto;
    color: #1a1a2e;
}

/* ============ FORM HEADER ============ */
.f230-form-header {
    text-align: center;
    padding: 40px 30px 30px;
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #3949ab 100%);
    border-radius: 16px 16px 0 0;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.f230-form-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 60%);
    pointer-events: none;
}

.f230-form-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.15);
    border-radius: 16px;
    margin-bottom: 16px;
    backdrop-filter: blur(10px);
}

.f230-form-header-icon svg {
    color: #fff;
}

.f230-form-header h2 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff !important;
}

.f230-form-subtitle {
    margin: 0;
    font-size: 14px;
    opacity: 0.85;
    font-weight: 400;
    line-height: 1.5;
    max-width: 500px;
    margin: 0 auto;
}

/* ============ FORM ============ */
.f230-form {
    background: #ffffff;
    border: 1px solid #e0e4ef;
    border-top: none;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 8px 40px rgba(26, 35, 126, 0.08), 0 2px 8px rgba(0,0,0,0.04);
}

/* ============ SECTIONS ============ */
.f230-section {
    border: none;
    margin: 0;
    padding: 30px 35px 25px;
    border-bottom: 1px solid #eef0f5;
}

.f230-section:last-of-type {
    border-bottom: none;
}

.f230-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #1a237e;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8eaf6;
}

.f230-section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ============ FIELDS ============ */
.f230-row {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.f230-row-1 { grid-template-columns: 1fr; }
.f230-row-2 { grid-template-columns: 1fr 1fr; }
.f230-row-3 { grid-template-columns: 1fr 1fr 0.5fr; }
.f230-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.f230-field {
    display: flex;
    flex-direction: column;
}

.f230-field label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.f230-required {
    color: #ef4444;
    font-weight: 600;
}

.f230-field input[type="text"],
.f230-field input[type="email"],
.f230-field input[type="tel"],
.f230-field select {
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2937;
    background: #fafbfc;
    transition: all 0.2s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.f230-field input:focus,
.f230-field select:focus {
    border-color: #3949ab;
    box-shadow: 0 0 0 3px rgba(57, 73, 171, 0.12);
    background: #fff;
}

.f230-field input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.f230-field input.f230-field-error,
.f230-field select.f230-field-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    background: #fef2f2;
}

.f230-error-msg {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
    min-height: 0;
    transition: all 0.2s ease;
}

.f230-error-msg:not(:empty) {
    min-height: 16px;
}

/* ============ ADDRESS GROUP ============ */
.f230-address-group {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px dashed #e5e7eb;
}

.f230-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    margin: 0 0 16px;
}

/* ============ CHECKBOXES ============ */
.f230-checkboxes-group {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed #e5e7eb;
}

.f230-checkbox-field {
    margin-bottom: 12px;
}

.f230-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    color: #4b5563;
}

.f230-checkbox-label input[type="checkbox"] {
    display: none;
}

.f230-checkbox-custom {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    background: #fafbfc;
    transition: all 0.2s ease;
    position: relative;
    margin-top: 1px;
}

.f230-checkbox-label input:checked + .f230-checkbox-custom {
    background: linear-gradient(135deg, #1a237e, #3949ab);
    border-color: #1a237e;
}

.f230-checkbox-label input:checked + .f230-checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.f230-checkbox-label input.f230-field-error + .f230-checkbox-custom {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ============ SIGNATURE ============ */
.f230-signature-area {
    text-align: center;
}

.f230-signature-instructions {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
}

.f230-canvas-container {
    position: relative;
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    border: 2px dashed #c7d2fe;
    background: #fafbff;
    transition: border-color 0.2s ease;
    cursor: crosshair;
}

.f230-canvas-container:hover {
    border-color: #818cf8;
}

.f230-canvas-container.f230-drawing {
    border-color: #3949ab;
    border-style: solid;
}

#f230-signature-canvas {
    display: block;
    background: transparent;
    touch-action: none;
}

.f230-signature-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #a5b4fc;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.f230-signature-placeholder span {
    font-size: 14px;
    font-weight: 500;
}

.f230-signature-placeholder.f230-hidden {
    opacity: 0;
}

.f230-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 18px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #6b7280;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.f230-btn-secondary:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

#f230-signature-error {
    display: block;
    text-align: center;
    margin-top: 8px;
}

/* ============ CONSENT ============ */
.f230-section-consent {
    background: #f8f9fc;
}

.f230-consent-field {
    padding: 12px;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

/* ============ SUBMIT ============ */
.f230-submit-area {
    padding: 25px 35px 35px;
    text-align: center;
}

.f230-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 40px;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(26, 35, 126, 0.3);
    min-width: 260px;
    position: relative;
    overflow: hidden;
}

.f230-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.f230-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(26, 35, 126, 0.4);
}

.f230-btn-primary:hover::before {
    left: 100%;
}

.f230-btn-primary:active {
    transform: translateY(0);
}

.f230-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.f230-spinner {
    animation: f230-spin 1s linear infinite;
}

@keyframes f230-spin {
    to { transform: rotate(360deg); }
}

.f230-submit-note {
    margin-top: 12px;
    font-size: 12px;
    color: #9ca3af;
}

/* ============ SUCCESS MESSAGE ============ */
.f230-success-message {
    background: #ffffff;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(26, 35, 126, 0.08);
    border: 1px solid #e0e4ef;
    animation: f230-fadeIn 0.5s ease;
}

.f230-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    color: #fff;
    margin-bottom: 24px;
    animation: f230-scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.f230-success-message h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px;
}

.f230-success-message p {
    font-size: 15px;
    color: #6b7280;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

@keyframes f230-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes f230-scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .f230-form-wrapper {
        margin: 20px 10px;
    }

    .f230-section {
        padding: 20px 20px 15px;
    }

    .f230-row-2,
    .f230-row-3 {
        grid-template-columns: 1fr;
    }

    .f230-row-4 {
        grid-template-columns: 1fr 1fr;
    }

    .f230-form-header {
        padding: 30px 20px 25px;
    }

    .f230-form-header h2 {
        font-size: 22px;
    }

    .f230-submit-area {
        padding: 20px;
    }

    .f230-btn-primary {
        width: 100%;
        min-width: auto;
    }

    #f230-signature-canvas {
        width: 100% !important;
        height: 150px !important;
    }

    .f230-canvas-container {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .f230-row-4 {
        grid-template-columns: 1fr;
    }

    .f230-section-title {
        font-size: 14px;
    }
}

/* ================================================
   Contract Sponsorizare – Specific Styles
   ================================================ */

/* Green theme for sponsorship form header */
.cspons-form-wrapper .f230-form-header {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 50%, #388e3c 100%);
}

.cspons-form-wrapper .f230-section-number {
    background: linear-gradient(135deg, #1b5e20, #388e3c);
}

.cspons-form-wrapper .f230-section-title {
    color: #1b5e20;
    border-bottom-color: #e8f5e9;
}

.cspons-form-wrapper .f230-field input:focus,
.cspons-form-wrapper .f230-field select:focus {
    border-color: #388e3c;
    box-shadow: 0 0 0 3px rgba(56, 142, 60, 0.12);
}

.cspons-form-wrapper .f230-btn-primary {
    background: linear-gradient(135deg, #1b5e20, #388e3c);
    box-shadow: 0 4px 15px rgba(27, 94, 32, 0.3);
}

.cspons-form-wrapper .f230-btn-primary:hover {
    box-shadow: 0 6px 25px rgba(27, 94, 32, 0.4);
}

.cspons-form-wrapper .f230-checkbox-label input:checked + .f230-checkbox-custom {
    background: linear-gradient(135deg, #1b5e20, #388e3c);
    border-color: #1b5e20;
}

.cspons-form-wrapper .f230-canvas-container:hover {
    border-color: #66bb6a;
}

/* Beneficiary info display */
.cspons-beneficiar-section {
    background: #f1f8f1;
}

.cspons-beneficiar-info {
    padding: 16px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #c8e6c9;
}

.cspons-info-row {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    line-height: 1.5;
}

.cspons-info-row:last-child {
    border-bottom: none;
}

.cspons-info-label {
    font-weight: 600;
    color: #1b5e20;
    min-width: 100px;
    flex-shrink: 0;
}

.cspons-info-value {
    color: #374151;
}

/* Date input styling */
.cspons-form .f230-field input[type="date"] {
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2937;
    background: #fafbfc;
    transition: all 0.2s ease;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.cspons-form .f230-field input[type="date"]:focus {
    border-color: #388e3c;
    box-shadow: 0 0 0 3px rgba(56, 142, 60, 0.12);
    background: #fff;
}

/* Sponsorship signature canvas */
#cspons-signature-canvas {
    display: block;
    background: transparent;
    touch-action: none;
}

@media (max-width: 768px) {
    #cspons-signature-canvas {
        width: 100% !important;
        height: 150px !important;
    }

    .cspons-info-row {
        flex-direction: column;
        gap: 2px;
    }

    .cspons-info-label {
        min-width: auto;
    }
}

