/* ============================================================
   KORSO MARITIME — Client Portal
   Stylesheet : login + portal pages
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary-blue:  #006A9A;
    --primary-dark:  #004d73;
    --text-dark:     #2F3133;
    --text-light:    #666666;
    --bg-light:      #f8f9fa;
    --bg-blue-light: #f0f4ff;
    --border-color:  #eaeaea;
    --shadow-sm:     0 2px 10px rgba(0,0,0,.05);
    --shadow-md:     0 5px 20px rgba(0,0,0,.10);
    --shadow-lg:     0 10px 40px rgba(0,0,0,.15);
    --transition:    0.3s ease;
}

/* ============================================================
   BASE
   ============================================================ */

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

body.login-page {
    height: 100vh;
    overflow: hidden;
    justify-content: space-between;
}

.login-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 0;
}

.login-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    animation: fadeInUp .5s ease-out both;
}

/* Header */
.card-header {
    background: var(--primary-blue);
    padding: 24px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand-block {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.brand-title {
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    line-height: 1;
}

.brand-secure {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    font-weight: 600;
    color: rgba(255,255,255,.7);
}

.brand-secure i { color: #6ee7b7; }

.header-divider {
    width: 1px;
    height: 44px;
    background: rgba(255,255,255,.25);
    flex-shrink: 0;
}

.header-right {
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    text-align: right;
    line-height: 1.6;
}

/* Body */
.card-body {
    padding: 28px 36px 24px;
}

.card-body h2 {
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.card-body .subtitle {
    font-size: .82rem;
    color: var(--text-light);
    margin-bottom: 22px;
    font-weight: 400;
}

.alert-error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fdecea;
    border: 1px solid #ef9a9a;
    color: #c62828;
    padding: 11px 14px;
    border-radius: 4px;
    margin-bottom: 18px;
    font-size: .85rem;
    font-weight: 500;
}

.alert-error i { flex-shrink: 0; }

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-dark);
    margin-bottom: 7px;
}

.input-wrapper { position: relative; }

.input-wrapper i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: .88rem;
    pointer-events: none;
    transition: color var(--transition);
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px 12px 38px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-dark);
    text-transform: uppercase;
    background: var(--bg-light);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
}

.input-wrapper input::placeholder {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    color: #bbb;
}

.input-wrapper input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0,106,154,.1);
    background: #fff;
}

.input-wrapper:focus-within i { color: var(--primary-blue); }

.field-hint {
    font-size: .72rem;
    color: var(--text-light);
    margin-top: 6px;
    font-weight: 400;
}

.btn-login {
    width: 100%;
    padding: 13px;
    background: var(--primary-blue);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: .88rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login:hover  { background: var(--primary-dark); transform: translateY(-2px); }
.btn-login:active { transform: translateY(0); }

/* Card footer */
.card-footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    padding: 13px 36px;
    text-align: center;
    font-size: .72rem;
    color: var(--text-light);
    line-height: 1.6;
}

.card-footer a {
    color: var(--primary-blue);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition);
}

.card-footer a:hover { color: var(--primary-dark); }

/* Page footer (login) */
.page-footer {
    background: #f5f5f5;
    padding: 12px 20px;
    text-align: right;
    flex-shrink: 0;
}

.page-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.footer-logo {
    font-weight: 800;
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-blue);
}

.footer-sub {
    font-size: .72rem;
    color: var(--text-light);
}

/* ============================================================
   PORTAL PAGE
   ============================================================ */

/* Navbar */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 30px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.nav-logo {
    height: 44px;
    width: auto;
    flex-shrink: 0;
}

.nav-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    height: 44px;
}

.nav-brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-blue);
    line-height: 1;
    white-space: nowrap;
}

.nav-brand-sub {
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: .4px;
    white-space: nowrap;
}

.nav-divider {
    width: 1px;
    height: 36px;
    background: var(--border-color);
    flex-shrink: 0;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.client-logo-img {
    height: 40px;
    width: auto;
    max-width: 110px;
    object-fit: contain;
}

.client-code-badge {
    background: var(--bg-blue-light);
    border: 1px solid #c3d4ef;
    color: var(--primary-blue);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 100px;
    white-space: nowrap;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-light);
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .5px;
    transition: color var(--transition);
    white-space: nowrap;
}

.btn-logout:hover { color: var(--primary-blue); }

/* Main content */
.main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 48px 30px 60px;
}

.page-top {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e8edf5;
}

.page-top h1 {
    font-size: 1.35rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.page-top p {
    font-size: .83rem;
    color: var(--text-light);
    font-weight: 400;
}

.file-count {
    font-size: .8rem;
    color: var(--text-light);
    margin-bottom: 14px;
    font-weight: 500;
}

.file-count strong { color: var(--primary-blue); }

/* File list */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-row {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
    animation: fadeInUp .4s ease both;
}

.file-row:hover {
    box-shadow: var(--shadow-md);
    border-color: #c3d4ef;
    transform: translateX(3px);
}

.file-row:nth-child(1) { animation-delay: .05s; }
.file-row:nth-child(2) { animation-delay: .10s; }
.file-row:nth-child(3) { animation-delay: .15s; }
.file-row:nth-child(4) { animation-delay: .20s; }
.file-row:nth-child(5) { animation-delay: .25s; }

.file-icon {
    font-size: 1.5rem;
    width: 34px;
    text-align: center;
    flex-shrink: 0;
}

.file-info { flex: 1; min-width: 0; }

.file-description {
    flex: 1.5;
    min-width: 0;
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-light);
    font-style: italic;
    padding: 0 16px;
    border-left: 2px solid var(--border-color);
    line-height: 1.5;
    white-space: pre-line;
}

.file-name {
    font-size: .92rem;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.file-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: .73rem;
    color: var(--text-light);
    font-weight: 500;
}

.file-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    background: var(--primary-blue);
    color: #fff;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background var(--transition), transform var(--transition);
}

.btn-download:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Empty state */
.empty-state {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 60px 40px;
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    color: #c3d4ef;
    margin-bottom: 16px;
    display: block;
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: .85rem;
    color: var(--text-light);
}

/* Portal footer */
.portal-footer {
    background: #f5f5f5;
    border-top: 1px solid var(--border-color);
    padding: 16px 30px;
    text-align: right;
}

.portal-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE — TABLET (≤ 768px)
   ============================================================ */

@media (max-width: 768px) {

    /* Login */
    body.login-page {
        height: auto;
        overflow: auto;
        min-height: 100vh;
    }

    .login-wrapper { padding: 24px 16px; }

    .card-header {
        padding: 20px 24px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .header-divider { display: none; }
    .header-right   { text-align: left; font-size: .8rem; }
    .brand-title    { font-size: 1.2rem; }

    .card-body   { padding: 24px 24px 20px; }
    .card-footer { padding: 12px 24px; }

    .page-footer { text-align: center; }
    .page-footer-content { align-items: center; }

    /* Portal navbar */
    .nav-inner { padding: 0 16px; height: 64px; }
    .nav-logo  { height: 38px; }

    .nav-brand-text { display: none; }
    .nav-divider    { display: none; }

    .nav-right { gap: 12px; }
    .client-logo-img { height: 34px; max-width: 90px; }

    .btn-logout span { display: none; }
    .btn-logout      { font-size: .9rem; }

    /* Portal main */
    .main { padding: 28px 16px 40px; }

    .page-top h1   { font-size: 1.1rem; }
    .page-top p    { font-size: .8rem; }

    .file-row {
        padding: 14px 16px;
        gap: 10px;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .file-icon { margin-top: 2px; flex-shrink: 0; }

    .file-info {
        flex: 1;
        min-width: 0;
        width: calc(100% - 50px);
    }

    .file-description {
        display: block !important;
        width: 100%;
        flex-basis: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding: 10px 0 0 0;
        margin-top: 2px;
    }

    .file-name { font-size: .88rem; }

    .portal-footer { padding: 14px 16px; text-align: center; }
    .portal-footer-inner { align-items: center; }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤ 480px)
   ============================================================ */

@media (max-width: 480px) {

    /* Login card full width */
    .login-card { border-radius: 6px; }
    .brand-title { font-size: 1.1rem; }

    /* File row stacks vertically */
    .file-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    .file-info { width: calc(100% - 46px); }

    .file-description {
        display: block !important;
        width: 100%;
        flex-basis: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding: 10px 0 0 0;
    }

    .btn-download {
        width: 100%;
        justify-content: center;
        padding: 11px;
    }

    .file-name { white-space: normal; word-break: break-word; }

    .empty-state { padding: 40px 20px; }
}