* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
}

body {
    background: linear-gradient(135deg, #e3f0ff 0%, #cfe4ff 100%);
    min-height: 100vh;
    color: #16324f;
}

a {
    color: #1565c0;
    text-decoration: none;
}

/* ---- Header ---- */
header {
    background: #1565c0;
    color: #fff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.3);
}

header h1 {
    font-size: 22px;
    letter-spacing: 0.5px;
}

header .user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

header .user-info a {
    background: #ffffff22;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    transition: background 0.2s;
}

header .user-info a:hover {
    background: #ffffff3d;
}

/* ---- Auth pages (login/register) ---- */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-box {
    background: #fff;
    padding: 40px 36px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(21, 101, 192, 0.18);
    width: 100%;
    max-width: 360px;
}

.auth-box h1 {
    text-align: center;
    color: #1565c0;
    margin-bottom: 4px;
    font-size: 28px;
}

.auth-box p.subtitle {
    text-align: center;
    color: #6c8bb5;
    margin-bottom: 24px;
    font-size: 14px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #2b587f;
    font-weight: 600;
}

.field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #bcd6f2;
    border-radius: 8px;
    font-size: 14px;
    background: #f4f9ff;
    color: #16324f;
}

.field input:focus {
    outline: none;
    border-color: #1565c0;
    background: #fff;
}

.btn {
    display: inline-block;
    width: 100%;
    background: #1565c0;
    color: #fff;
    border: none;
    padding: 11px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.btn:hover {
    background: #0d47a1;
}

.btn-secondary {
    background: #64b5f6;
}

.btn-secondary:hover {
    background: #42a5f5;
}

.btn-danger {
    background: #e53935;
}

.btn-danger:hover {
    background: #c62828;
}

.switch-link {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    color: #5a7ea6;
}

.error {
    background: #ffe3e3;
    color: #c62828;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.success {
    background: #e3f6e8;
    color: #2e7d32;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* ---- App layout ---- */
.container {
    max-width: 960px;
    margin: 30px auto;
    padding: 0 20px;
}

.note-form {
    background: #fff;
    padding: 24px;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(21, 101, 192, 0.12);
    margin-bottom: 28px;
}

.note-form h2 {
    color: #1565c0;
    margin-bottom: 16px;
    font-size: 18px;
}

.note-form textarea {
    width: 100%;
    min-height: 110px;
    padding: 10px 12px;
    border: 1px solid #bcd6f2;
    border-radius: 8px;
    font-size: 14px;
    background: #f4f9ff;
    color: #16324f;
    resize: vertical;
}

.note-form textarea:focus,
.note-form input:focus {
    outline: none;
    border-color: #1565c0;
    background: #fff;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.note-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(21, 101, 192, 0.1);
    border-top: 4px solid #1565c0;
    display: flex;
    flex-direction: column;
}

.note-card h3 {
    color: #16324f;
    margin-bottom: 8px;
    font-size: 16px;
    word-break: break-word;
}

.note-card p {
    color: #4a6685;
    font-size: 14px;
    line-height: 1.5;
    flex-grow: 1;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 12px;
}

.note-card .meta {
    font-size: 12px;
    color: #90a9c4;
    margin-bottom: 12px;
}

.note-card .actions {
    display: flex;
    gap: 10px;
}

.note-card .actions a {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    background: #e3f0ff;
    color: #1565c0;
    font-weight: 600;
}

.note-card .actions a.delete {
    background: #ffe3e3;
    color: #c62828;
}

.note-card .actions a:hover {
    opacity: 0.8;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7d97b5;
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
}
