:root {
    --apple-blue: #007AFF;
    --apple-gray: #F2F2F7;
    --apple-light-gray: #FAFAFA;
    --apple-medium-gray: #E5E5E5;
    --apple-dark-gray: #1C1C1E;
    --apple-text: rgba(55, 65, 81, 1);
    --apple-secondary-text: #3C3C43;
    --apple-border: #E5E5E7;
    --apple-grey-bg: #D9D9D9;
    --apple-shadow: rgba(0, 0, 0, 0.1);
    --apple-radius: 12px;
    --apple-radius-small: 8px;
}
header {
    background: linear-gradient(135deg, #FAFAFA 0%, #F0F0F0 100%) !important;
    border-bottom: 1px solid rgba(229, 229, 231, 0.5) !important;
}
body {
    background: linear-gradient(135deg, #FAFAFA 0%, #F0F0F0 100%);
    color: var(--apple-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.47;
    letter-spacing: -0.022em;
}

/* Utilities */
.font-bold {
    font-weight: 600;
}
.uppercase {
    text-transform: uppercase;
}

/* Back to landing */
.back-to-landing {
    display: inline-flex;
    position: fixed;
    top: 87px;
    left: 30px;
    min-height: auto;
    font-size: 15px;
    padding: 16px 32px;
}
.back-to-landing iconify-icon {
    margin-top: 0.2rem;
}

/* Tile styles (displayed as cards in Pear theme) */
.tile {
    background: #FFF;
    border: 1px solid var(--apple-border);
    border-radius: var(--apple-radius);
    box-shadow: 0 1px 3px var(--apple-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.2s ease-in-out;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Color variants for tiles - using colored icon backgrounds */
.tile iconify-icon {
    border-radius: 50%;
    padding: 16px;
    font-size: 1.875rem;
    line-height: 2.25rem;
    width: 64px;
    height: 64px;
}
.tile.tile-success iconify-icon {
    background-color: rgba(209, 250, 229, 1);
    color: rgba(5, 150, 105, 1);
}
.tile.tile-danger iconify-icon {
    background-color: rgba(254, 226, 226, 1);
    color: rgba(220, 38, 38, 1);
}
.tile h2,
.tile h3 {
    color: var(--apple-dark-gray);
    font-weight: 600;
    margin-bottom: 12px;
}
.tile p {
    color: #6B7280;
    margin-bottom: 24px;
}
.tile .tile-arrow {
    color: var(--apple-blue);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}
.tile:hover .tile-arrow iconify-icon {
    transform: translateX(4px);
    transition: transform 0.2s ease-in-out;
}
.tile.datetime {
    font-family: 'Roboto Mono', monospace;
    font-weight: 300;
}

/* Cards */
.card {
    background: #FFF;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.2s ease-in-out;
    padding: 24px;
}
.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Registration tabs */
.registration-tabs {
    font-size: 14px;
    background: rgba(243, 244, 246, 1);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    margin-bottom: 16px;
}
.registration-tabs button {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: #E0E0E0;
    color: rgba(75, 85, 99, 1);
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    border-radius: 8px;
    margin-right: 2px;
}
.registration-tabs button:last-child {
    margin-right: 0;
}
.registration-tabs button.active {
    background: var(--apple-blue);
    color: #FFF;
    font-weight: 600;
}
.registration-tabs button:not(.active) {
    background: transparent;
    color: var(--apple-text);
}
.registration-tabs button:not(.active):hover {
    background: #D0D0D0;
}

/* Form inputs */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    background: #FFF;
    border: 1px solid #CCC;
    border-radius: 6px;
    color: #333;
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.2s ease-in-out;
    box-shadow: none;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
.input:focus,
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #4285F4;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}
input::placeholder,
textarea::placeholder {
    color: #AAA;
}

/* Checkbox specific styles */
input[type="checkbox"] {
    width: auto !important;
    min-width: 1.25rem;
    min-height: 1.25rem !important;
    width: 1.25rem;
    height: 1.25rem;
    padding: 0 !important;
    margin: 0;
    border-radius: 4px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #FFF;
    border: 2px solid #CCC;
    flex-shrink: 0;
    box-shadow: none;
    transition: all 0.2s ease-in-out;
}

input[type="checkbox"]:checked {
    background-color: var(--apple-blue);
    border-color: var(--apple-blue);
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-7 7a1 1 0 01-1.414 0l-3.5-3.5a1 1 0 011.414-1.414L4.5 10.586l6.293-6.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

input[type="checkbox"]:focus {
    outline: none;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    transform: none;
}

input[type="checkbox"]:hover {
    border-color: var(--apple-blue);
}

/* Form labels */
label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Side-by-side form fields */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

/* Form spacing */
.form-group {
    margin-bottom: 24px;
}

/* Required field indicator */
.text-red-400 {
    color: #EF4444;
}

/* Mode description text */
#mode-description {
    color: #666;
    font-size: 14px;
    text-align: center;
    margin-top: 16px;
    font-weight: 300;
}

/* Dropdown styles */
.dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
}
.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: var(--apple-text);
    background-color: var(--apple-light-gray);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    border-bottom: 1px solid var(--apple-border);
    cursor: pointer;
}
.dropdown-item:last-child {
    border-bottom: none;
}
.dropdown-item:hover {
    background-color: var(--apple-medium-gray);
    color: var(--apple-text);
}
.dropdown-item:focus {
    background-color: var(--apple-medium-gray);
    color: var(--apple-blue);
    outline: none;
}
.dropdown-location {
    font-size: 0.75rem;
    color: var(--apple-text);
    margin-top: 4px;
    font-weight: 400;
}
.dropdown-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--apple-text);
    margin-bottom: 2px;
}

/* Buttons */
.btn-primary,
button[type="submit"],
button[data-role="primary"] {
    background: #007BFF;
    color: #FFF;
    border: none;
    border-radius: 6px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.022em;
    transition: all 0.2s ease-in-out;
    box-shadow: none;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
.btn-primary:hover,
button[type="submit"]:hover,
button[data-role="primary"]:hover {
    background: #0056CC;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}
.btn-primary:active,
button[type="submit"]:active,
button[data-role="primary"]:active {
    transform: translateY(0);
    box-shadow: none;
}
.btn-secondary {
    background: var(--apple-gray);
    color: var(--apple-text);
    border: 1px solid var(--apple-border);
    border-radius: var(--apple-radius-small);
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}
.btn-secondary:hover {
    background: #E8E8ED;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--apple-shadow);
}

/* Print Badge Button */
.btn-print-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    background: var(--apple-grey-bg); /* o un colore che si distingua dal btn-primary */
    color: var(--apple-text);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.btn-print-badge:hover {
    background: var(--apple-medium-gray);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: -0.022em;
    color: var(--apple-dark-gray);
}
h1 {
    font-size: 28px;
}
h2 {
    font-size: 24px;
}
h3 {
    font-size: 20px;
}

/* Grid layout */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    padding: 24px;
}
.tile-grid.tile-grid-large {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding: 24px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

/* Focus states */
*:focus {
    outline: 2px solid var(--apple-blue);
    outline-offset: 2px;
}

/* Smooth animations */
* {
    transition: all 0.2s ease-in-out;
}

/* ReceptionPro field error styles - Apple-style subtle */
.rp-field-error {
    border-color: #FF3B30 !important;
    border-width: 1px !important;
    box-shadow: 0 0 0 2px rgba(255, 59, 48, 0.1) !important;
    background-color: rgba(255, 59, 48, 0.02) !important;
}
.rp-error-message {
    color: #FF3B30;
    font-size: 12px;
    margin-top: 6px;
    padding: 4px 0;
    text-align: left;
    background-color: transparent;
    border: none;
    font-weight: 400;
    letter-spacing: -0.01em;
}
.rp-general-error-alert {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    margin-bottom: 20px;
    background-color: rgba(255, 59, 48, 0.06);
    border: 1px solid rgba(255, 59, 48, 0.2);
    border-radius: var(--apple-radius-small);
    color: #FF3B30;
    font-size: 14px;
    font-weight: 400;
    text-align: center;
    animation: fade-in 0.25s ease-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.rp-general-error-alert iconify-icon {
    font-size: 16px;
    opacity: 0.8;
}
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Topbar specific styles */
.topbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(229, 229, 231, 0.5);
}
.topbar-logo-container {
    height: 32px;
    width: auto;
}
.topbar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--apple-dark-gray);
}
.topbar-subtitle {
    font-size: 14px;
    color: #6B7280;
}
.topbar-nav-link {
    color: #4B5563;
    font-weight: 500;
    padding: 0 24px;
}
.topbar-nav-link:hover {
    color: var(--apple-blue);
}
.topbar-lang-toggle {
    color: #4B5563;
    font-weight: 500;
    padding: 8px 12px;
}
.topbar-lang-toggle:hover {
    color: var(--apple-blue);
}

/* Footer styles */
footer {
    position: static;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 50px;
    bottom: 0;
    background: rgba(249, 250, 251, 0.5);
    border-top: 1px solid rgba(229, 229, 231, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
footer .footer-text {
    font-size: 14px;
    color: #6B7280;
}

/* Back tile specific styling */
.back-tile {
    min-height: auto;
    padding: 16px 32px;
    background: #FFF;
    border: 1px solid var(--apple-border);
    box-shadow: 0 1px 3px var(--apple-shadow);
    color: var(--apple-text);
    border-radius: var(--apple-radius);
    position: relative;
    overflow: hidden;
    font-size: 18px;
    font-weight: 300;
    text-transform: none;
    letter-spacing: 0.02em;
}

/* Layout-specific visibility */
.layout-vertical-only {
    display: none;
}
.layout-horizontal-only {
    display: block;
}
