/* ==========================================================================
   APAD Login Page — self-contained styles (no build step required).
   Loaded directly via <link> in resources/views/welcome.blade.php.
   ==========================================================================
   Brand colors (must match projectrules.txt section 2):
     primary  #0B3C8C
     dark     #061d4a
     light    #1e5bbf
     accent   #f59e0b (amber-500 — sole non-blue accent for slider dots)
   ========================================================================== */

:root {
    --apad-primary: #0B3C8C;
    --apad-dark: #061d4a;
    --apad-light: #1e5bbf;
    --apad-accent: #f59e0b;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --red-50: #fef2f2;
    --red-200: #fecaca;
    --red-700: #b91c1c;
    --blue-50: #eff6ff;
    --blue-200: #bfdbfe;
    --blue-700: #1d4ed8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--slate-100);
    background: radial-gradient(circle at top left, rgba(30, 91, 191, 0.35), transparent 55%),
                radial-gradient(circle at bottom right, rgba(11, 60, 140, 0.45), transparent 60%),
                linear-gradient(135deg, #061d4a 0%, #0B3C8C 50%, #1e5bbf 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

img {
    display: block;
    max-width: 100%;
}

/* ----- Layout ----- */

.login-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@media (min-width: 1024px) {
    .login-layout { flex-direction: row; }
}

/* ----- Left side: form ----- */

.login-form-side {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
}

@media (min-width: 1024px) {
    .login-form-side { width: 50%; }
}

.login-form-content {
    width: 100%;
    max-width: 28rem;
}

.login-brand {
    margin-bottom: 2rem;
    text-align: center;
}

.login-brand img {
    margin: 0 auto;
    height: 3rem;
    width: auto;
}

.login-brand h1 {
    margin-top: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

.login-brand p {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--slate-300);
}

/* ----- Card ----- */

.login-card {
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
}

.login-card h2 {
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--slate-900);
}

.login-card .subtitle {
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--slate-500);
}

/* ----- Alerts ----- */

.alert {
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.alert-error {
    border: 1px solid var(--red-200);
    background: var(--red-50);
    color: var(--red-700);
}

.alert-info {
    border: 1px solid var(--blue-200);
    background: var(--blue-50);
    color: var(--blue-700);
}

/* ----- Form ----- */

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group { display: block; }

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-700);
}

.form-input {
    display: block;
    width: 100%;
    border: 1px solid var(--slate-300);
    border-radius: 0.5rem;
    background: #fff;
    padding: 0.625rem 1rem;
    font-size: 1rem;
    color: var(--slate-900);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
    outline: none;
    border-color: var(--apad-primary);
    box-shadow: 0 0 0 3px rgba(11, 60, 140, 0.15);
}

.password-field {
    position: relative;
}

.password-field .form-input { padding-right: 2.75rem; }

.password-toggle {
    position: absolute;
    inset: 0 0 0 auto;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    color: var(--slate-400);
    transition: color 0.15s;
}

.password-toggle:hover { color: var(--slate-600); }

.password-toggle svg { width: 1.25rem; height: 1.25rem; }

/* ----- Helper row (remember + forgot) ----- */

.form-helper-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--slate-700);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    height: 1rem;
    width: 1rem;
    border-radius: 0.25rem;
    border: 1px solid var(--slate-300);
    accent-color: var(--apad-primary);
    cursor: pointer;
}

.text-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--apad-primary);
    transition: color 0.15s;
}

.text-link:hover { color: var(--apad-dark); }

/* ----- Primary button ----- */

.btn-primary {
    width: 100%;
    border-radius: 0.5rem;
    background: var(--apad-primary);
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    transition: background-color 0.15s, box-shadow 0.15s;
}

.btn-primary:hover { background: var(--apad-dark); }

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(11, 60, 140, 0.35);
}

.login-card .help-text {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--slate-500);
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
}

/* ----- Right side: announcement carousel ----- */

.login-carousel-side {
    display: none;
    position: relative;
    width: 50%;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
}

@media (min-width: 1024px) {
    .login-carousel-side { display: flex; }
}

.carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(6, 29, 74, 0.4), transparent);
    pointer-events: none;
}

.carousel-content {
    position: relative;
    width: 100%;
    max-width: 32rem;
}

.carousel-eyebrow {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.7);
}

.carousel-eyebrow .dot {
    height: 0.375rem;
    width: 0.375rem;
    border-radius: 9999px;
    background: var(--apad-accent);
    animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.slide {
    display: block;
}

.slide.hidden { display: none; }

.slide img {
    margin-bottom: 1.5rem;
    height: 12rem;
    width: 100%;
    border-radius: 1rem;
    object-fit: cover;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.slide h2 {
    margin-bottom: 1rem;
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

.slide-content {
    margin-bottom: 1.5rem;
    max-width: 28rem;
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(241, 245, 249, 0.9);
}

.slide-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: rgba(203, 213, 225, 0.85);
}

.slide-meta svg { width: 1rem; height: 1rem; }

/* ----- Slider dots ----- */

.slider-dots {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slider-dot {
    height: 0.5rem;
    width: 0.625rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.slider-dot.active {
    width: 2.5rem;
    background: var(--apad-accent);
}

/* ----- Empty state (no announcements) ----- */

.empty-state {
    text-align: center;
}

.empty-icon {
    margin: 0 auto 1.5rem;
    display: flex;
    height: 5rem;
    width: 5rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    color: #fcd34d;
}

.empty-icon svg { width: 2.5rem; height: 2.5rem; }

.empty-state h2 {
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.empty-state p {
    margin: 0 auto;
    max-width: 22rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: rgba(241, 245, 249, 0.8);
}

/* ----- Forgot password modal ----- */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.7);
    padding: 1rem;
}

.modal-overlay.hidden { display: none; }

.modal {
    width: 100%;
    max-width: 28rem;
    border-radius: 1rem;
    background: #fff;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    color: var(--slate-900);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    color: var(--slate-400);
    transition: color 0.15s;
}

.modal-close:hover { color: var(--slate-600); }

.modal-close svg { width: 1.25rem; height: 1.25rem; }

.modal p {
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--slate-600);
}

.admin-contact-box {
    border-radius: 0.5rem;
    background: var(--slate-100);
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--slate-600);
}

.admin-contact-box .label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--slate-700);
}

.admin-contact-box a {
    font-weight: 500;
    color: var(--apad-primary);
}

.admin-contact-box a:hover { text-decoration: underline; }

.modal .btn-primary {
    margin-top: 1.25rem;
}

/* ----- Announcement actions ----- */

.slide-readmore,
.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    transition: color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.slide-readmore {
    margin-top: 0.75rem;
}

.slide-readmore:hover,
.view-all-btn:hover {
    color: #fff;
}

.slide-readmore svg,
.view-all-btn svg,
.announcement-list-icon svg,
.announcement-list-arrow {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.view-all-btn {
    margin-top: 2rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.625rem 0.875rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.view-all-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* ----- Announcement modals ----- */

.modal--lg {
    max-width: 42rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.modal-eyebrow {
    margin-bottom: 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--apad-primary);
}

.modal-sub {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--slate-500);
}

.announcement-body {
    font-size: 0.925rem;
    line-height: 1.7;
    color: var(--slate-700);
}

.announcement-body > * + * {
    margin-top: 0.75rem;
}

.announcement-body a {
    color: var(--apad-primary);
    font-weight: 600;
    text-decoration: underline;
}

.announcement-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.announcement-list-item {
    display: flex;
    width: 100%;
    align-items: flex-start;
    gap: 0.875rem;
    border-radius: 0.75rem;
    background: var(--slate-100);
    padding: 0.875rem;
    text-align: left;
    color: var(--slate-700);
    transition: background-color 0.15s, box-shadow 0.15s;
}

.announcement-list-item:hover {
    background: #fff;
    box-shadow: 0 0 0 1px var(--slate-200), 0 10px 20px -16px rgba(15, 23, 42, 0.35);
}

.announcement-list-icon {
    display: flex;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(11, 60, 140, 0.1);
    color: var(--apad-primary);
}

.announcement-list-text {
    min-width: 0;
    flex: 1;
}

.pin-badge {
    display: inline-flex;
    margin-bottom: 0.375rem;
    border-radius: 9999px;
    background: rgba(245, 158, 11, 0.14);
    padding: 0.125rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #92400e;
}

.announcement-list-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--slate-900);
}

.announcement-list-summary {
    margin-top: 0.25rem;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--slate-600);
}

.announcement-list-meta {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: var(--slate-500);
}

.announcement-list-arrow {
    margin-top: 0.625rem;
    color: var(--slate-400);
}
