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

html,
body {
    height: 100%;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fafaf8;
    color: #333;
}

#loading-indicator {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: #888;
}

/* Login */

#login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 2rem;
}

#login-container h1 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 280px;
}

#login-form input {
    padding: 0.6rem 0;
    border: none;
    border-bottom: 1px solid #ccc;
    font-size: 1.0625rem;
    outline: none;
    background-color: #fafaf8;
}

#login-form input:focus {
    border-bottom-color: #333;
}

#toggle-password {
    background: none;
    border: none;
    font-size: 0.8125rem;
    color: #888;
    cursor: pointer;
    padding: 0.25rem;
}

#login-form button {
    margin-top: 0.5rem;
    padding: 0.6rem;
    background: #333;
    color: #fff;
    border: none;
    font-size: 1rem;
    cursor: pointer;
}

#login-error {
    font-size: 0.875rem;
    color: #888;
    text-align: center;
    min-height: 1.25rem;
}

/* App container */

#app-container {
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

/* Events list */

.empty-message {
    text-align: center;
    color: #aaa;
    padding: 3rem 0;
    font-size: 1rem;
}

.event-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
}

.event-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.event-title {
    font-size: 1.0625rem;
}

.event-datetime {
    font-size: 0.875rem;
    color: #999;
}

.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.3;
    display: flex;
    align-items: center;
}

.delete-btn:hover {
    opacity: 0.6;
}

/* FAB */

.fab {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
    right: 1.5rem;
    width: 62px;
    height: 62px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.fab:hover {
    background: #444;
}

/* Dialog */

dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 1.25rem;
    width: calc(100%);
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.3);
}

dialog h2 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

#event-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#event-form input {
    padding: 0.5rem 0;
    border: none;
    border-bottom: 1px solid #ccc;
    font-size: 1.0625rem;
    outline: none;
    background-color: transparent;
}

#event-form input:focus {
    border-bottom-color: #333;
}

.dialog-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.dialog-buttons button {
    padding: 0.4rem 0.75rem;
    font-size: 0.9375rem;
    cursor: pointer;
}

#cancel-btn {
    background: none;
    border: 1px solid #ddd;
    color: #666;
}

#cancel-btn:hover {
    border-color: #999;
}

#event-form button[type="submit"] {
    background: #333;
    color: #fff;
    border: none;
}

#event-form button[type="submit"]:hover {
    background: #444;
}

/* Responsive - wider screens */

@media (min-width: 600px) {
    #events-list {
        max-width: 600px;
        margin: 0 auto;
        padding-left: 2rem;
        padding-right: 2rem;
    }

    dialog {
        max-width: 400px;
    }
}

@media (min-width: 1024px) {
    #events-list {
        max-width: 720px;
        padding-left: 3rem;
        padding-right: 3rem;
    }
}
