* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(97, 86, 255, 0.18), transparent 35%),
        radial-gradient(circle at bottom right, rgba(0, 204, 255, 0.12), transparent 35%),
        #0b1020;
    color: #f5f7ff;
}

body {
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}


/* =========================================================
   AUTH PAGES
========================================================= */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: rgba(17, 24, 45, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 38px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(18px);
}

.lock-icon {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
    border-radius: 22px;
    background: linear-gradient(
        135deg,
        rgba(104, 92, 255, 0.22),
        rgba(0, 199, 255, 0.14)
    );
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 36px;
}

.auth-card h1 {
    margin: 0;
    text-align: center;
    font-size: 32px;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.subtitle {
    margin: 12px 0 30px;
    text-align: center;
    color: #aeb7cf;
    font-size: 15px;
    line-height: 1.6;
}

.auth-card label,
.note-editor label {
    display: block;
    margin: 18px 0 8px;
    color: #dbe1f3;
    font-size: 14px;
    font-weight: 700;
}

.auth-card input,
.note-editor input,
.note-editor textarea,
.search-form input {
    width: 100%;
    border: 1px solid #2c385b;
    outline: none;
    background: #0d1428;
    color: #ffffff;
    border-radius: 14px;
    padding: 14px 16px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.auth-card input:focus,
.note-editor input:focus,
.note-editor textarea:focus,
.search-form input:focus {
    border-color: #7468ff;
    background: #111a31;
    box-shadow: 0 0 0 4px rgba(116, 104, 255, 0.13);
}

.auth-card input::placeholder,
.note-editor input::placeholder,
.note-editor textarea::placeholder,
.search-form input::placeholder {
    color: #65708c;
}

.auth-card button,
.button-link,
.save-button,
.add-note-button,
.search-form button {
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    border-radius: 14px;
    padding: 0 20px;
    background: linear-gradient(135deg, #7568ff, #4d7cff);
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.3px;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease;
}

.auth-card button {
    width: 100%;
    margin-top: 24px;
}

.auth-card button:hover,
.button-link:hover,
.save-button:hover,
.add-note-button:hover,
.search-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(77, 124, 255, 0.25);
    filter: brightness(1.05);
}

.bottom-link {
    margin-top: 24px;
    text-align: center;
    color: #8893ad;
    font-size: 14px;
}

.bottom-link a {
    color: #8e84ff;
    font-weight: 700;
}

.bottom-link a:hover {
    text-decoration: underline;
}

.alert {
    margin: 18px 0;
    padding: 14px 16px;
    border-radius: 13px;
    font-size: 14px;
    line-height: 1.5;
}

.alert.error {
    background: rgba(255, 75, 95, 0.12);
    border: 1px solid rgba(255, 75, 95, 0.35);
    color: #ffb8c1;
}

.alert.success {
    background: rgba(53, 211, 153, 0.11);
    border: 1px solid rgba(53, 211, 153, 0.3);
    color: #a6f1d2;
}

.verification-warning {
    margin: 20px 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 187, 51, 0.1);
    border: 1px solid rgba(255, 187, 51, 0.3);
    color: #ffd88a;
    line-height: 1.55;
}


/* =========================================================
   VAULT PAGE
========================================================= */

.vault-page {
    min-height: 100vh;
}

.vault-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 5vw;
    background: rgba(8, 13, 28, 0.88);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.vault-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.vault-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(116, 104, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 25px;
}

.vault-brand h1 {
    margin: 0;
    font-size: 22px;
}

.vault-user {
    margin-top: 4px;
    color: #8490ac;
    font-size: 13px;
}

.lock-button {
    padding: 11px 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e7ebf7;
    font-weight: 700;
    transition: 0.2s ease;
}

.lock-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.vault-content {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 42px 0 60px;
}

.vault-toolbar {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
}

.search-form {
    flex: 1;
    display: flex;
    gap: 10px;
}

.search-form input {
    flex: 1;
}

.search-form button {
    min-width: 110px;
}

.add-note-button {
    white-space: nowrap;
}

.search-status {
    margin-bottom: 22px;
    color: #9aa5bf;
    font-size: 14px;
}

.search-status a {
    color: #8e84ff;
    font-weight: 700;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
}

.note-card {
    display: flex;
    flex-direction: column;
    min-height: 260px;
    padding: 22px;
    border-radius: 18px;
    background: rgba(17, 24, 45, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.16);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease;
}

.note-card:hover {
    transform: translateY(-3px);
    border-color: rgba(116, 104, 255, 0.35);
}

.note-card-header h2 {
    margin: 0 0 16px;
    font-size: 20px;
    color: #ffffff;
    word-break: break-word;
}

.note-content {
    flex: 1;
    color: #b9c1d6;
    font-size: 14px;
    line-height: 1.65;
    word-break: break-word;
}

.note-date {
    margin-top: 20px;
    color: #65708c;
    font-size: 12px;
}

.note-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.edit-button,
.delete-button,
.cancel-button {
    border: 0;
    min-height: 40px;
    padding: 0 15px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
}

.edit-button {
    background: rgba(116, 104, 255, 0.13);
    border: 1px solid rgba(116, 104, 255, 0.25);
    color: #bcb6ff;
}

.delete-button {
    background: rgba(255, 72, 92, 0.12);
    border: 1px solid rgba(255, 72, 92, 0.25);
    color: #ff9eaa;
}

.delete-form {
    margin: 0;
}

.empty-vault {
    padding: 70px 25px;
    text-align: center;
    border-radius: 20px;
    background: rgba(17, 24, 45, 0.72);
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 14px;
}

.empty-vault h2 {
    margin: 0 0 10px;
}

.empty-vault p {
    color: #8c97b1;
    margin: 0 0 24px;
}

.vault-footer {
    padding: 25px 20px 35px;
    text-align: center;
    color: #65708c;
    font-size: 13px;
}


/* =========================================================
   NOTE EDITOR
========================================================= */

.note-editor {
    max-width: 820px;
    margin: 0 auto;
    background: rgba(17, 24, 45, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 22px;
    padding: 30px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.24);
}

.note-editor textarea {
    resize: vertical;
    min-height: 300px;
    line-height: 1.6;
}

.encryption-message {
    margin-top: 18px;
    padding: 13px 15px;
    border-radius: 13px;
    background: rgba(63, 194, 255, 0.08);
    border: 1px solid rgba(63, 194, 255, 0.18);
    color: #a7daf3;
    font-size: 13px;
    line-height: 1.5;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.cancel-button {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: #cbd2e4;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 700px) {

    .auth-card {
        padding: 28px 22px;
        border-radius: 20px;
    }

    .auth-card h1 {
        font-size: 27px;
    }

    .vault-header {
        align-items: flex-start;
        padding: 18px 20px;
    }

    .vault-brand h1 {
        font-size: 18px;
    }

    .lock-button {
        padding: 10px 12px;
        font-size: 13px;
    }

    .vault-content {
        width: min(100% - 24px, 1180px);
        padding-top: 28px;
    }

    .vault-toolbar {
        flex-direction: column;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form button,
    .add-note-button {
        width: 100%;
    }

    .notes-grid {
        grid-template-columns: 1fr;
    }

    .note-editor {
        padding: 22px 18px;
    }

    .editor-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .save-button,
    .cancel-button {
        width: 100%;
    }
}