/* Guarantees the native `hidden` attribute always wins over any other
   display rule below, preventing future "toggle doesn't hide it" bugs. */
[hidden] { display: none !important; }

.aag-form-wrapper {
	background: #fff; border: 1px solid #e5e9f0; border-radius: 14px;
	padding: 26px; box-shadow: 0 10px 30px rgba(15,23,42,.06); max-width: 640px;
}
.aag-malayalam-font { font-family: 'AdityaMalayalam', 'Noto Sans Malayalam', sans-serif; }

/* Access denied */
.aag-access-denied {
	max-width: 420px; margin: 0 auto; background: #fff; border: 1px solid #e5e9f0; border-radius: 14px;
	padding: 30px; text-align: center; box-shadow: 0 10px 30px rgba(15,23,42,.06);
}
.aag-access-denied h3 { margin-bottom: 10px; }
.aag-access-denied p { color: #64748b; margin-bottom: 20px; }
.aag-access-denied form p { text-align: left; margin-bottom: 12px; }
.aag-access-denied input[type=text], .aag-access-denied input[type=password] {
	width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px;
}
.aag-access-denied input[type=submit] {
	width: 100%; padding: 11px; background: #0b5fff; color: #fff; border: none; border-radius: 8px;
	font-weight: 600; cursor: pointer; margin-top: 6px;
}

/* Applications list */
.aag-list-wrapper { max-width: 720px; margin: 0 auto 30px; background: #fff; border: 1px solid #e5e9f0; border-radius: 14px; padding: 24px; box-shadow: 0 10px 30px rgba(15,23,42,.06); }
.aag-list-title { margin-bottom: 14px; }
.aag-list-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.aag-list-table th, .aag-list-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #e5e9f0; }
.aag-list-table th { color: #64748b; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.aag-list-actions a { margin-right: 12px; color: #0b5fff; font-weight: 600; }
.aag-list-actions a.aag-delete-link { color: #b91c1c; }
.aag-list-actions a:hover { text-decoration: underline; }

.aag-form-title { margin-bottom: 18px; }
.aag-field-row { margin-bottom: 16px; }
.aag-field-row label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.aag-field-row input[type=text], .aag-field-row input[type=email], .aag-field-row textarea {
	width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: .95rem;
}
.aag-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.aag-lang-toggle { display: flex; gap: 20px; font-weight: 500; }
.aag-lang-toggle label { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.aag-checkbox-label { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 600; font-size: .88rem; }
.aag-transliteration-hint { margin-top: 6px; line-height: 1.5; }
.aag-submit { width: 100%; text-align: center; }
.aag-error { color: #b91c1c; background: #fee2e2; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }

.aag-result-wrapper { max-width: 720px; margin: 0 auto 30px; }
.aag-result-toolbar { display: flex; gap: 12px; margin-bottom: 20px; align-items: center; flex-wrap: wrap; }
.aag-saved-note { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; padding: 12px 16px; border-radius: 8px; font-weight: 600; margin: 0; flex: 1 1 260px; }
.aag-print-area {
	background: #fff; border: 1px solid #cbd5e1; padding: 50px 60px; box-shadow: 0 10px 30px rgba(15,23,42,.08);
	font-family: 'Poppins', 'Noto Sans Malayalam', serif; color: #111; line-height: 1.8;
}
.aag-lang-ml { font-family: 'Noto Sans Malayalam', sans-serif; }
.aag-doc-header h2 { text-align: center; text-decoration: underline; margin-bottom: 24px; font-size: 1.3rem; }
.aag-doc-meta { text-align: right; margin-bottom: 20px; }
.aag-doc-to { margin-bottom: 18px; }
.aag-doc-subject { margin-bottom: 18px; }
.aag-doc-salutation { margin-bottom: 14px; }
.aag-doc-body { margin-bottom: 30px; text-align: justify; }
.aag-doc-closing { margin-bottom: 50px; }
.aag-doc-signature p { margin: 2px 0; }
.aag-field { font-size: .92rem; }

@media (max-width: 600px) {
	.aag-two-col { grid-template-columns: 1fr; }
	.aag-print-area { padding: 30px 20px; }
}

@media print {
	.aag-form-wrapper, .no-print { display: none !important; }
	.aag-print-area { box-shadow: none; border: none; padding: 0; }
	body * { visibility: hidden; }
	.aag-print-area, .aag-print-area * { visibility: visible; }
	.aag-print-area { position: absolute; left: 0; top: 0; width: 100%; }
}
