/* Area Riservata Pro - stili frontend
   Colore principale: variabile --arp-primary (Impostazioni del plugin) */

.arp {
	--arp-primary: #2563eb;
	--arp-text: #0f172a;
	--arp-muted: #64748b;
	--arp-border: #e2e8f0;
	--arp-bg: #ffffff;
	--arp-soft: #f8fafc;
	--arp-radius: 14px;
	--arp-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);

	color: var(--arp-text);
	font-family: inherit;
	line-height: 1.5;
	box-sizing: border-box;
}
.arp *, .arp *::before, .arp *::after { box-sizing: border-box; }
.arp [hidden] { display: none !important; }

/* Card */
.arp-card {
	background: var(--arp-bg);
	border: 1px solid var(--arp-border);
	border-radius: calc(var(--arp-radius) + 4px);
	box-shadow: var(--arp-shadow);
	padding: 36px;
	max-width: 440px;
	margin: 0 auto;
}
.arp-card-wide { max-width: 860px; }
.arp-gate .arp-card, .arp-login .arp-card { text-align: left; }

.arp-title { margin: 0 0 6px; font-size: 1.6rem; line-height: 1.2; font-weight: 700; color: var(--arp-text); }
.arp-sub { margin: 0 0 22px; color: var(--arp-muted); }
.arp-section { margin: 28px 0 6px; font-size: 1.05rem; font-weight: 700; }
.arp-hint { margin: 0 0 14px; color: var(--arp-muted); font-size: .9rem; }

/* Form */
.arp-field { margin-bottom: 16px; }
.arp-field label { display: block; margin-bottom: 6px; font-size: .9rem; font-weight: 600; }
.arp-field input[type="text"],
.arp-field input[type="email"],
.arp-field input[type="password"] {
	width: 100%;
	padding: 12px 14px;
	font-size: 1rem;
	color: var(--arp-text);
	background: var(--arp-soft);
	border: 1px solid var(--arp-border);
	border-radius: 10px;
	outline: none;
	transition: border-color .15s, box-shadow .15s, background .15s;
}
.arp-field input:focus {
	background: #fff;
	border-color: var(--arp-primary);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--arp-primary) 18%, transparent);
}
.arp-field input:disabled { opacity: .65; cursor: not-allowed; }

.arp-pass { position: relative; }
.arp-pass input { padding-right: 46px; }
.arp-eye {
	position: absolute; top: 0; right: 0; height: 100%; width: 46px;
	display: flex; align-items: center; justify-content: center;
	background: transparent; border: 0; color: var(--arp-muted); cursor: pointer;
}
.arp-eye:hover { color: var(--arp-text); }

.arp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 20px; flex-wrap: wrap; }
.arp-check { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.arp-link { color: var(--arp-primary); font-size: .9rem; text-decoration: none; }
.arp-link:hover { text-decoration: underline; }

.arp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.arp-span-2 { grid-column: span 2; }

/* Bottoni */
.arp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 12px 22px;
	font-size: 1rem; font-weight: 600; line-height: 1.2;
	color: #fff !important;
	background: var(--arp-primary);
	border: 1px solid var(--arp-primary);
	border-radius: 10px;
	text-decoration: none !important;
	cursor: pointer;
	transition: filter .15s, transform .05s, background .15s;
}
.arp-btn:hover { filter: brightness(1.08); }
.arp-btn:active { transform: translateY(1px); }
.arp-btn-block { width: 100%; }
.arp-btn-sm { padding: 8px 14px; font-size: .88rem; }
.arp-btn-ghost {
	color: var(--arp-text) !important;
	background: transparent;
	border-color: var(--arp-border);
}
.arp-btn-ghost:hover { background: var(--arp-soft); filter: none; }

/* Avvisi */
.arp-notice { padding: 12px 14px; margin-bottom: 18px; border-radius: 10px; font-size: .92rem; border: 1px solid; }
.arp-notice-error { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.arp-notice-success { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }

/* Intestazione */
.arp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.arp-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Area documenti */
.arp-area { width: 100%; }
.arp-toolbar {
	display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
	padding: 12px 16px; margin: 6px 0 22px;
	background: var(--arp-soft);
	border: 1px solid var(--arp-border);
	border-radius: var(--arp-radius);
}
.arp-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .95rem; }
.arp-crumbs a { color: var(--arp-primary); text-decoration: none; font-weight: 600; }
.arp-crumbs a:hover { text-decoration: underline; }
.arp-sep { color: var(--arp-muted); }
.arp-current { font-weight: 700; }

.arp-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.arp-search { position: relative; display: flex; align-items: center; }
.arp-search svg { position: absolute; left: 12px; color: var(--arp-muted); pointer-events: none; }
.arp-search input {
	padding: 9px 12px 9px 36px; min-width: 220px;
	font-size: .92rem; color: var(--arp-text);
	background: #fff; border: 1px solid var(--arp-border); border-radius: 10px; outline: none;
}
.arp-search input:focus { border-color: var(--arp-primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--arp-primary) 18%, transparent); }

.arp-viewswitch { display: inline-flex; background: #fff; border: 1px solid var(--arp-border); border-radius: 10px; overflow: hidden; }
.arp-viewswitch button { padding: 8px 11px; color: var(--arp-muted); background: transparent; border: 0; cursor: pointer; display: flex; }
.arp-viewswitch button.is-active { color: #fff; background: var(--arp-primary); }

/* Elementi */
.arp-items { display: grid; gap: 16px; }
.arp-area[data-view="grid"] .arp-items { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.arp-area[data-view="list"] .arp-items { grid-template-columns: 1fr; gap: 8px; }

.arp-item {
	position: relative;
	background: var(--arp-bg);
	border: 1px solid var(--arp-border);
	border-radius: var(--arp-radius);
	transition: border-color .15s, box-shadow .15s, transform .15s;
}
.arp-item:hover { border-color: color-mix(in srgb, var(--arp-primary) 45%, var(--arp-border)); box-shadow: var(--arp-shadow); }
.arp-area[data-view="grid"] .arp-item:hover { transform: translateY(-2px); }

.arp-item-main { display: flex; color: inherit !important; text-decoration: none !important; }
.arp-area[data-view="grid"] .arp-item-main { flex-direction: column; align-items: center; text-align: center; padding: 24px 14px 18px; gap: 14px; }
.arp-area[data-view="list"] .arp-item-main { flex-direction: row; align-items: center; padding: 10px 56px 10px 14px; gap: 14px; }

.arp-item-icon { display: flex; flex-shrink: 0; }
.arp-area[data-view="list"] .arp-item-icon svg { width: 40px; height: 40px; }
.arp-item-text { display: flex; flex-direction: column; min-width: 0; width: 100%; }
.arp-name { font-weight: 600; font-size: .95rem; word-break: break-word; overflow-wrap: anywhere; }
.arp-meta { color: var(--arp-muted); font-size: .8rem; margin-top: 2px; }
.arp-area[data-view="list"] .arp-item-text { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 16px; }
.arp-area[data-view="list"] .arp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arp-area[data-view="list"] .arp-meta { white-space: nowrap; margin: 0; }

.arp-item-dl {
	position: absolute; display: flex; align-items: center; justify-content: center;
	width: 34px; height: 34px;
	color: var(--arp-muted) !important; background: var(--arp-soft);
	border: 1px solid var(--arp-border); border-radius: 9px; text-decoration: none !important;
	transition: color .15s, background .15s, border-color .15s;
}
.arp-item-dl:hover { color: #fff !important; background: var(--arp-primary); border-color: var(--arp-primary); }
.arp-area[data-view="grid"] .arp-item-dl { top: 8px; right: 8px; }
.arp-area[data-view="list"] .arp-item-dl { top: 50%; right: 12px; transform: translateY(-50%); }

.arp-empty { text-align: center; padding: 56px 20px; color: var(--arp-muted); background: var(--arp-soft); border: 1px dashed var(--arp-border); border-radius: var(--arp-radius); }
.arp-empty p { margin: 10px 0 0; }
.arp-nomatch { text-align: center; color: var(--arp-muted); padding: 20px; }

/* Mobile */
@media (max-width: 640px) {
	.arp-card { padding: 24px 20px; }
	.arp-grid-2 { grid-template-columns: 1fr; }
	.arp-span-2 { grid-column: auto; }
	.arp-search input { min-width: 0; width: 100%; }
	.arp-search { width: 100%; }
	.arp-tools { width: 100%; justify-content: space-between; }
	.arp-area[data-view="grid"] .arp-items { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.arp-area[data-view="list"] .arp-item-text { flex-direction: column; gap: 0; }
}
