/* NewHaven Software — Customer Download Area v2 */

:root {
    --color-brand: #2e2e8c;
    --color-brand-light: #4a4ab8;
    --color-brand-dark: #1c1c5e;
    --color-accent: #3f69be;
    --color-success: #1a7f37;
    --color-success-light: #dafbe1;
    --color-text: #1a1a2e;
    --color-text-muted: #555;
    --color-bg: #f5f7fa;
    --color-white: #fff;
    --color-border: #d0d7de;
    --color-border-light: #e8ecf0;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --max-width: 860px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
}

/* Layout */
.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 20px;
}

/* Header */
.site-header {
    background: var(--color-brand-dark);
    border-bottom: 3px solid var(--color-accent);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo img {
    height: 40px;
    display: block;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.welcome {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
}

.logout-link {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    transition: all 0.15s;
}

.logout-link:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.1);
}

/* Footer */
.site-footer {
    background: var(--color-brand-dark);
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}

.footer-inner a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
}

.footer-inner a:hover {
    color: #fff;
}

/* Page heading */
.page-heading {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 24px;
}

/* Login page */
.login-container {
    max-width: 420px;
    margin: 60px auto;
}

.login-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 40px;
}

.login-card .logo-center {
    text-align: center;
    margin-bottom: 8px;
}

.login-card .logo-center img {
    display: inline-block;
    height: 44px;
}

.login-card h1 {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
    letter-spacing: 0;
}

.login-card .subtitle {
    text-align: center;
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 28px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-white);
    color: var(--color-text);
    transition: border-color 0.15s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(63,105,190,0.15);
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.15s;
    line-height: 1.4;
}

.btn-primary {
    background: var(--color-brand);
    color: var(--color-white);
    width: 100%;
}

.btn-primary:hover {
    background: var(--color-brand-light);
}

.login-error {
    background: #fdecea;
    color: #b71c1c;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 18px;
    border: 1px solid #f5c6cb;
}

.login-help {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.login-help a {
    color: var(--color-accent);
    text-decoration: none;
}

.login-help a:hover {
    text-decoration: underline;
}

/* Hero download section */
.hero-download {
    background: linear-gradient(135deg, var(--color-success-light) 0%, #e8f5e9 100%);
    border: 2px solid var(--color-success);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    margin-bottom: 32px;
}

.hero-download h2 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-success);
    margin-bottom: 16px;
}

.hero-download .download-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 36px;
    font-size: 18px;
    font-weight: 700;
    background: var(--color-success);
    color: var(--color-white);
    border-radius: var(--radius);
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: all 0.15s;
}

.hero-download .download-btn:hover {
    background: #15652c;
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.hero-download .download-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.hero-download .file-info {
    margin-top: 12px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.hero-download .release-notes-link {
    display: inline-block;
    margin-top: 12px;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.hero-download .release-notes-link:hover {
    text-decoration: underline;
}

/* Section headings */
.section-heading {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border-light);
}

/* Doc cards grid */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}

.doc-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px;
    text-decoration: none;
    color: var(--color-text);
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doc-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.doc-card .file-type {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
}

.file-type-pdf { background: #fde8e8; color: #c62828; }
.file-type-exe { background: #e3f2fd; color: #1565c0; }
.file-type-chm { background: #fff3e0; color: #e65100; }
.file-type-doc { background: #e8eaf6; color: #283593; }
.file-type-zip { background: #f3e5f5; color: #6a1b9a; }
.file-type-file { background: #eceff1; color: #37474f; }

.doc-card .file-name {
    font-size: 14px;
    font-weight: 500;
    word-break: break-word;
}

.doc-card .file-date {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Reference section (collapsible) */
.reference-section {
    margin-bottom: 32px;
}

.reference-section summary {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border-light);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.reference-section summary::-webkit-details-marker { display: none; }

.reference-section summary::before {
    content: '\25B6'; /* right triangle */
    font-size: 11px;
    color: var(--color-text-muted);
    transition: transform 0.15s;
}

.reference-section[open] summary::before {
    transform: rotate(90deg);
}

.reference-section .file-count {
    font-size: 13px;
    font-weight: 400;
    color: var(--color-text-muted);
}

.reference-list {
    list-style: none;
    margin-top: 12px;
}

.reference-list li {
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.reference-list li:last-child { border-bottom: none; }

.reference-list a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.reference-list a:hover {
    color: var(--color-accent);
}

.reference-list .ref-name {
    word-break: break-word;
}

.reference-list .ref-date {
    font-size: 12px;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Release notes */
.release-notes-wrapper {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-top: 16px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

.back-link:hover {
    text-decoration: underline;
}

/* No-update message */
.no-update {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    color: var(--color-text-muted);
}

/* Responsive */
@media (max-width: 600px) {
    .site-main { padding: 20px 14px; }
    .login-card { padding: 28px 22px; }
    .hero-download { padding: 24px 18px; }
    .hero-download .download-btn { padding: 12px 24px; font-size: 16px; }
    .doc-grid { grid-template-columns: 1fr; }
    .header-inner { flex-direction: column; gap: 8px; }
    .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}
