/* ================================
   KARTA ICE – MODERNIZACJA STYLU
   ================================ */

:root {
    /* Paleta kolorów */
    --primary: #10b981;
    --primary-dark: #059669;
    --accent: #ef4444;
    --accent-hover: #dc2626;
    --bg-page: #f9fafb;
    --bg-card: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --input-bg: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
}

body {
    margin: 0;
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ================================
   CONTAINER
   ================================ */

.ice-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 20px 120px;
}

/* ================================
   HEADER
   ================================ */

.ice-header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

.ice-header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

.ice-subtitle {
    margin-top: 8px;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
}

/* ================================
   INFO SECTION (BOX)
   ================================ */

.ice-info-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}

.ice-info-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--text-main);
}

.ice-info-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 8px;
}

.ice-info-section p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.ice-info-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.btn-link,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-link {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-link:hover {
    background: #f3f4f6;
    color: var(--text-main);
}

.btn-secondary {
    background: #fee2e2;
    color: var(--accent);
    border: 1px solid transparent;
}

.btn-secondary:hover {
    background: #fecaca;
    transform: translateY(-1px);
}

/* ================================
   FORM & SECTIONS
   ================================ */

.ice-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.form-section:hover {
    box-shadow: var(--shadow-md);
    border-color: #d1d5db;
}

.section-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Layout for fields in Section 1 */
.form-section:nth-of-type(1) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-section:nth-of-type(1) .section-title {
    grid-column: 1 / -1;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label:not(.checkbox-label) {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

/* ================================
   INPUTS & SELECTS
   ================================ */

input[type="text"],
input[type="date"],
input[type="number"],
input[type="tel"],
select,
textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* placeholders for combined labels */
.form-section input::placeholder {
    color: #9ca3af;
}

.form-section input[name="doctorName"],
.form-section input[name="doctorPhone"],
.form-section input[name="doctorClinic"],
.form-section input[name="contactName"],
.form-section input[name="contactRelation"],
.form-section input[name="contactPhone"] {
    margin-bottom: 8px;
}

/* ================================
   CHECKBOX STYLING
   ================================ */

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    padding: 8px 12px;
    background: #f0fdf4;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-dark);
    cursor: pointer;
    width: fit-content;
}

.checkbox-label:hover {
    background: #dcfce7;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* ================================
   FORM ACTIONS
   ================================ */

.form-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.form-actions button[type="submit"] {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.4);
}

.form-actions button[type="submit"]:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
}

.form-actions button[type="submit"]:active {
    transform: translateY(0);
}

/* ================================
   RESPONSIVE ADJUSTMENTS
   ================================ */

@media (max-width: 640px) {
    .ice-header h1 {
        font-size: 1.8rem;
    }

    .ice-container {
        padding: 0 16px 100px;
    }

    .form-section {
        padding: 20px;
    }

    .form-actions button[type="submit"] {
        width: 100%;
    }
}