* {
    box-sizing: border-box;
}

:root {
    --ocean-dark: #064663;
    --ocean: #0a9396;
    --ocean-light: #94d2bd;
    --sand: #f4e7c5;
    --foam: #f8fbff;
    --coral: #ee6c4d;
    --text-dark: #16323f;
    --muted: #5f7f89;
    --shadow: rgba(6, 70, 99, 0.18);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text-dark);
    background: linear-gradient(rgba(255,255,255,0.18), rgba(255,255,255,0.18)),
    url("../images/beach.png");
background-size: cover;
background-position: center;
background-attachment: fixed;
    overflow-x: hidden;
}

.background-waves {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.85), transparent 22%),
        radial-gradient(circle at 85% 25%, rgba(255, 255, 255, 0.45), transparent 26%),
        radial-gradient(circle at 50% 85%, rgba(255, 255, 255, 0.65), transparent 35%);
    animation: breeze 14s ease-in-out infinite alternate;
}

.background-waves::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.35) 45%, transparent 70%),
        linear-gradient(160deg, transparent 10%, rgba(255,255,255,0.25) 55%, transparent 80%);
    opacity: 0.7;
    animation: windLines 18s linear infinite;
}

@keyframes breeze {
    from {
        transform: translateX(-18px) translateY(-8px);
    }
    to {
        transform: translateX(18px) translateY(8px);
    }
}

@keyframes windLines {
    from {
        transform: translateX(-70px);
    }
    to {
        transform: translateX(70px);
    }
}

/* LOGIN PAGE */

.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 28px;
}

.hero-card {
    width: 100%;
    max-width: 980px;
    padding: 38px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.55);
    box-shadow: 0 22px 50px var(--shadow);
}

.brand-area {
    text-align: center;
    margin-bottom: 28px;
}

.logo-circle {
    width: 78px;
    height: 78px;
    margin: 0 auto 14px auto;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ocean-light), var(--ocean-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: bold;
    box-shadow: 0 12px 25px rgba(6,70,99,0.22);
}

.tagline {
    margin: 8px 0;
    font-size: 24px;
    color: var(--ocean-dark);
    font-weight: bold;
}

.description {
    margin: 0 auto;
    max-width: 560px;
    color: var(--muted);
    font-size: 16px;
}

.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.auth-grid .form-section {
    background: rgba(255,255,255,0.64);
    border-radius: 22px;
    padding: 24px;
    border: 1px solid rgba(10,147,150,0.15);
}

.signup-box {
    border-left: 5px solid var(--ocean-light);
}

@media (max-width: 850px) {
    .auth-grid {
        grid-template-columns: 1fr;
    }

    .hero-card {
        padding: 24px;
    }
}

.card {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 26px;
    padding: 32px;
    box-shadow: 0 20px 45px var(--shadow);
    width: 100%;
    max-width: 450px;
}

.wide-card {
    max-width: 1050px;
    margin: 22px auto;
}

h1 {
    margin: 0;
    font-size: 46px;
    color: var(--ocean-dark);
    letter-spacing: -1px;
}

h2 {
    margin-bottom: 12px;
    color: var(--ocean-dark);
}

.subtitle {
    margin-top: 8px;
    color: var(--muted);
    font-size: 16px;
}

.form-section {
    margin-top: 22px;
}

input {
    width: 100%;
    padding: 14px;
    margin: 8px 0;
    border: 1px solid #b7d9db;
    border-radius: 14px;
    font-size: 15px;
    background: rgba(255,255,255,0.9);
    color: var(--text-dark);
    outline: none;
}

input:focus {
    border-color: var(--ocean);
    box-shadow: 0 0 0 3px rgba(10,147,150,0.16);
}

button {
    width: 100%;
    padding: 14px;
    margin-top: 10px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--ocean), var(--ocean-dark));
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cancel-btn {
    background: #6c757d;
    margin-top: 10px;
}

.cancel-btn:hover {
    background: #555f66;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(6,70,99,0.18);
}

button:active {
    transform: translateY(0);
}

.message {
    min-height: 22px;
    font-size: 14px;
    color: var(--ocean-dark);
    font-weight: bold;
}

hr {
    border: none;
    border-top: 1px solid rgba(6,70,99,0.15);
    margin: 28px 0;
}

/* DASHBOARD */

.dashboard {
    padding: 28px;
}

.dashboard-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.small-logo {
    width: 58px;
    height: 58px;
    font-size: 20px;
    margin: 0;
}

.dashboard-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card {
    min-width: 100px;
    padding: 12px 18px;
    border-radius: 18px;
    background: rgba(255,255,255,0.72);
    border: 1px solid rgba(10,147,150,0.18);
    text-align: center;
}

.stat-card span {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: var(--ocean-dark);
}

.stat-card p {
    margin: 2px 0 0 0;
    font-size: 13px;
    color: var(--muted);
}

.dashboard-header {
    max-width: 1050px;
    margin: 0 auto 22px auto;
    padding: 24px 28px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(14px);
    box-shadow: 0 16px 35px var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header p {
    margin: 6px 0 0 0;
    color: var(--muted);
    font-weight: bold;
}

.logout-btn {
    width: auto;
    padding: 12px 22px;
    background: linear-gradient(135deg, var(--coral), #c84e34);
}

.contact-form {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    align-items: center;
}

.search-row {
    display: grid;
    grid-template-columns: 1fr 160px;
    gap: 12px;
}

.contacts-list {
    margin-top: 22px;
}

.contact-item {
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(10,147,150,0.18);
    border-left: 6px solid var(--ocean);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: 0 8px 20px rgba(6,70,99,0.08);
}

.contact-item strong {
    display: block;
    font-size: 19px;
    margin-bottom: 8px;
    color: var(--ocean-dark);
}

.contact-item p {
    margin: 5px 0;
    color: var(--muted);
}

.contact-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.contact-actions button {
    width: auto;
    padding: 10px 16px;
    font-size: 14px;
}

.delete-btn {
    background: linear-gradient(135deg, var(--coral), #c84e34);
}

.cancel-btn {
    background: #6c757d;
    margin-top: 10px;
}

.cancel-btn:hover {
    background: #555f66;
}

#editSection {
    border: 2px solid rgba(238,108,77,0.28);
}

.contact-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.contact-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--ocean-light),
        var(--ocean-dark)
    );

    color: white;
    font-weight: bold;

    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-subtitle {
    color: var(--muted);
    font-size: 13px;
}

.contact-details {
    margin-top: 10px;
}

.contact-details p {
    margin: 6px 0;
}

.welcome-banner {
    max-width: 1050px;
    margin: 0 auto 24px auto;

    padding: 24px 28px;

    border-radius: 24px;

    background: rgba(255,255,255,0.70);

    backdrop-filter: blur(12px);

    display: flex;
    justify-content: space-between;
    align-items: center;

    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

.welcome-banner h2 {
    margin: 0 0 8px 0;
}

.welcome-banner p {
    margin: 0;
    color: var(--muted);
}

.welcome-stats {
    display: flex;
    gap: 16px;
}

.mini-stat {
    text-align: center;

    padding: 12px 20px;

    border-radius: 16px;

    background: rgba(255,255,255,0.75);
}

.mini-stat span {
    display: block;

    font-size: 28px;

    font-weight: bold;

    color: var(--ocean-dark);
}

.mini-stat small {
    color: var(--muted);
}

/* ACCESSIBILITY */

button:focus,
input:focus {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    .background-waves,
    .background-waves::after,
    button {
        animation: none;
        transition: none;
    }
}

/* MOBILE */

@media (max-width: 850px) {

.welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

    .contact-form {
        grid-template-columns: 1fr;
    }

    .search-row {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

.dashboard-stats {
    width: 100%;
    flex-direction: column;
}

.stat-card {
    width: 100%;
}

.dashboard-brand {
    align-items: flex-start;
}

    .logout-btn {
        width: 100%;
    }

    h1 {
        font-size: 38px;
    }
}
