/* =========================================================
   LRP Engineer App — base stylesheet
   Phase 1: auth layout + app shell only
   ========================================================= */

/* ---------------------------------------------------------
   Reset / base
   --------------------------------------------------------- */

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

:root {
    --color-brand:       #1a1a2e;
    --color-brand-light: #16213e;
    --color-accent:      #0f3460;
    --color-text:        #1a1a2e;
    --color-text-muted:  #6b7280;
    --color-bg:          #f9fafb;
    --color-surface:     #ffffff;
    --color-border:      #e5e7eb;
    --color-error:       #dc2626;
    --color-error-bg:    #fef2f2;
    --color-success:     #16a34a;
    --color-success-bg:  #f0fdf4;

    --radius:  6px;
    --shadow:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --font:    system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------
   Auth layout
   --------------------------------------------------------- */

.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    background: var(--color-bg);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.auth-card__brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-card__logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-brand);
    letter-spacing: .05em;
}

.auth-card__tagline {
    font-size: .875rem;
    color: var(--color-text-muted);
    margin-top: .25rem;
}

/* ---------------------------------------------------------
   Forms
   --------------------------------------------------------- */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: .375rem;
    color: var(--color-text);
}

.form-input {
    width: 100%;
    padding: .5rem .75rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color .15s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(15,52,96,.12);
}

.form-actions {
    margin-top: 1.5rem;
}

.auth-form__help {
    font-size: .875rem;
    color: var(--color-text-muted);
    margin-bottom: 1.25rem;
}

.auth-form__links {
    margin-top: 1rem;
    text-align: center;
    font-size: .875rem;
}

.auth-link {
    color: var(--color-text-muted);
}

.auth-link:hover {
    color: var(--color-accent);
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .5rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}

.btn--primary {
    background: var(--color-brand);
    color: #fff;
    border-color: var(--color-brand);
}

.btn--primary:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.btn--full {
    width: 100%;
}

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

.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: .875rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}

.alert--error {
    background: var(--color-error-bg);
    color: var(--color-error);
    border-color: #fecaca;
}

.alert--success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border-color: #bbf7d0;
}

/* ---------------------------------------------------------
   App layout (authenticated shell)
   --------------------------------------------------------- */

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

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 56px;
    background: var(--color-brand);
    color: #fff;
    flex-shrink: 0;
}

.app-header__brand {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.app-header__logo {
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: .05em;
}

.app-header__name {
    font-size: .875rem;
    opacity: .8;
}

.app-header__nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: .875rem;
}

.app-header__user {
    opacity: .8;
}

.app-header__logout {
    color: #fff;
    opacity: .8;
}

.app-header__logout:hover {
    opacity: 1;
    text-decoration: none;
}

.app-body {
    display: flex;
    flex: 1;
}

.app-sidebar {
    width: 220px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    flex-shrink: 0;
}

.app-sidebar__nav {
    padding: 1rem 0;
}

.app-sidebar__link {
    display: block;
    padding: .625rem 1.25rem;
    font-size: .875rem;
    color: var(--color-text);
}

.app-sidebar__link:hover {
    background: var(--color-bg);
    text-decoration: none;
}

.app-main {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* ---------------------------------------------------------
   Dashboard shell
   --------------------------------------------------------- */

.dashboard-shell {
    max-width: 640px;
}

.dashboard-shell__heading {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.dashboard-shell__body {
    margin-bottom: .75rem;
}

.dashboard-shell__note {
    font-size: .875rem;
    color: var(--color-text-muted);
}

/* ---------------------------------------------------------
   Mobile responsiveness — auth card full-width on small screens
   --------------------------------------------------------- */

@media (max-width: 480px) {
    .auth-card {
        border: none;
        box-shadow: none;
        padding: 1.5rem 1rem;
    }

    .app-sidebar {
        display: none; /* sidebar hidden on mobile in Phase 1 */
    }
}
