/**
 * Main Custom Styles - Formularz Wypłata
 * EKO Pożyczka Refundacyjna - WFOŚiGW Szczecin
 */

:root {
    --primary-50: #ecfdf5;
    --primary-100: #d1fae5;
    --primary-200: #a7f3d0;
    --primary-300: #6ee7b7;
    --primary-400: #34d399;
    --primary-500: #10b981;
    --primary-600: #059669;
    --primary-700: #047857;
    --primary-800: #065f46;
    --primary-900: #064e3b;

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

/* ==================== Base Form Elements ==================== */

.form-input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="url"] {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--gray-900);
    background-color: #fff;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
}

select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    color: var(--gray-900);
    background-color: #fff;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
    cursor: pointer;
}

input[type="text"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
select:hover {
    border-color: var(--gray-400);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

input:disabled,
textarea:disabled {
    background-color: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-500);
    cursor: not-allowed;
}

textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--gray-900);
    background-color: #fff;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    outline: none;
    resize: vertical;
    font-family: inherit;
}

textarea:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* ==================== Checkboxes / Radios ==================== */

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"],
.checkbox-group input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary-600);
    cursor: pointer;
    flex-shrink: 0;
}

/* ==================== Form Section ==================== */

.form-section {
    background: white;
    border-radius: 1rem;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    border: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-800);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-100);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.form-label .required {
    color: #ef4444;
    margin-left: 2px;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* ==================== Invoice Table ==================== */

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.invoice-table th {
    background: var(--primary-700);
    color: white;
    padding: 0.625rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    border: 1px solid var(--primary-800);
}

.invoice-table td {
    padding: 0.85rem 0.35rem;
    border: 1px solid var(--gray-200);
    vertical-align: middle;
}

.invoice-table tr:nth-child(even) td {
    background-color: var(--gray-50);
}

.invoice-table tr:hover td {
    background-color: var(--primary-50);
}

.invoice-table .lp-cell {
    text-align: center;
    color: var(--gray-500);
    font-weight: 600;
    width: 2.5rem;
    background-color: var(--gray-50) !important;
}

.invoice-table input[type="text"],
.invoice-table input[type="number"],
.invoice-table input[type="date"],
.invoice-table select {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 0.375rem;
    border-width: 1.5px;
    font-family: inherit;
}

.invoice-table .sum-row td {
    background: var(--primary-50) !important;
    font-weight: 700;
    color: var(--primary-800);
    border-top: 2px solid var(--primary-300);
}

.invoice-table .remove-col {
    width: 2rem;
    padding: 0 0.2rem;
    text-align: center;
    border-left: 1px solid var(--gray-200);
}

.invoice-table .sum-row .sum-label {
    text-align: right;
    padding-right: 0.75rem;
}

/* ==================== Disabled / WFOSiGW section ==================== */

.wfos-section {
    background: var(--gray-50);
    border: 2px dashed var(--gray-300);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.wfos-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==================== Generate button ==================== */

.btn-generate {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
    letter-spacing: 0.01em;
}

.btn-generate:hover {
    background: linear-gradient(135deg, var(--primary-700), var(--primary-800));
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.45);
    transform: translateY(-1px);
}

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

.btn-generate:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    border-radius: 0.625rem;
    border: 1.5px solid rgba(239, 68, 68, 0.25);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.4);
}

/* ==================== Notification ==================== */

#notification {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    transition: all 0.3s ease;
}

.notification-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.18);
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 280px;
    max-width: 400px;
}

.notification-card.success {
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    color: #166534;
}

.notification-card.error {
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    color: #991b1b;
}

.notification-card.info {
    background: #eff6ff;
    border: 1.5px solid #93c5fd;
    color: #1e40af;
}

/* ==================== Loading Spinner ==================== */

.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Account number input ==================== */

.account-input {
    font-family: 'Courier New', monospace;
    letter-spacing: 0.1em;
    font-size: 1rem;
}

/* ==================== Account blocks ==================== */

.account-block {
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    background: var(--gray-50);
}

.account-block:last-child {
    margin-bottom: 0;
}

.account-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--gray-200);
}

.account-block-number {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-800);
}

.account-remove-btn {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    cursor: pointer;
    transition: all 0.15s ease;
}

.account-remove-btn:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.4);
}

/* ==================== Sum display ==================== */

.sum-display {
    display: block;
    background: var(--primary-50);
    border: 1.5px solid var(--primary-200);
    border-radius: 0.5rem;
    padding: 0.25rem 0.5rem;
    font-weight: 700;
    color: var(--primary-800);
    font-size: 0.8rem;
    text-align: right;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}
