:root {
    color-scheme: light;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7fb;
    color: #1f2937;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
}

.site-header {
    background: 
 url("/image/top.jpg") no-repeat center 30%;
 background-size: cover;
    color: white;
    padding: 2rem 1rem 1.5rem;
    text-align: center;
}  

.site-header h1 {
    margin: 0;
    font-size: 2.2rem;
}

.site-header p {
    margin: 0.75rem auto 0;
    max-width: 700px;
    font-size: 0.98rem;
    opacity: 0.9;
}

.main-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1rem auto 0;
    max-width: 720px;
}

.site-header .header-inner {
    position: relative;
}

.main-nav {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    max-width: none;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.2rem;
    background: rgba(255, 255, 255, 0.18);
    color: white;
    text-decoration: none;
    font-size: 0.92rem;
    min-width: 110px;
    transform: skew(-18deg);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.main-nav a span {
    display: inline-block;
    transform: skew(18deg);
}

.main-nav a:hover,
.main-nav a.active {
    background: rgba(255, 255, 255, 0.34);
}

.main-nav a:hover {
    transform: skew(-18deg) translateY(-2px);
}

@media (max-width: 720px) {
    .main-nav {
        position: static;
        justify-content: center;
        margin: 1rem auto 0;
    }
}

.page-content {
    padding: 2rem 1rem 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.cards-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.contact-section {
    background: linear-gradient(135deg, #090f34 0%, #0b195f 100%);
    padding: 3rem 1rem 4rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(380px, 1.05fr);
    gap: 2.5rem;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-intro {
    color: white;
    border-radius: 28px;
    padding: 2.5rem 2rem;
    min-height: 420px;
}

.contact-intro .eyebrow {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    opacity: 0.9;
}

.contact-intro h2 {
    margin: 0 0 1rem;
    font-size: clamp(3rem, 5vw, 4rem);
    line-height: 0.96;
}

.contact-intro p {
    margin: 0;
    max-width: 32rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95);
}

.contact-form {
    background: #ffffff;
    border-radius: 28px;
    padding: 2rem;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.16);
    display: grid;
    gap: 1.2rem;
    max-width: 560px;
    width: 100%;
}

.contact-form label {
    font-weight: 700;
    margin-bottom: 0.35rem;
    display: inline-block;
    color: #1f2937;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 1.2rem 1.2rem;
    font-size: 1rem;
    color: #0f172a;
    background: #f8fafc;
    min-height: 56px;
}

.contact-form textarea {
    min-height: 180px;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #2f7dff;
    box-shadow: 0 0 0 4px rgba(47, 125, 255, 0.14);
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.field-half {
    display: grid;
    gap: 0.55rem;
}

.contact-form textarea {
    min-height: 180px;
    resize: vertical;
}

.submit-button {
    background: #0f172a;
    color: white;
    border: none;
    border-radius: 18px;
    padding: 1.15rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.submit-button:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

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

@media (max-width: 640px) {
    .contact-intro h2 {
        font-size: 2.4rem;
    }

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

.login-section {
    padding: 3rem 1rem 4rem;
    min-height: calc(100vh - 130px);
    background: linear-gradient(135deg, #0d153c 0%, #081235 100%);
}

.login-card {
    max-width: 520px;
    margin: 0 auto;
    background: white;
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.2);
}

.login-card h2 {
    margin: 0 0 0.75rem;
    font-size: 2.4rem;
}

.login-description {
    margin: 0 0 1.75rem;
    line-height: 1.7;
    color: #334155;
}

.login-error,
.error {
    margin-bottom: 1rem;
    padding: 1rem 1.2rem;
    border-radius: 18px;
    background: #ffe7e7;
    color: #9b1c1c;
    border: 1px solid #f5c2c2;
    transition: opacity 0.4s ease, max-height 0.4s ease, margin 0.4s ease, padding 0.4s ease;
}

.login-success,
.success {
    margin-bottom: 1rem;
    padding: 1rem 1.2rem;
    border-radius: 18px;
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    transition: opacity 0.4s ease, max-height 0.4s ease, margin 0.4s ease, padding 0.4s ease;
}

.auto-hide {
    opacity: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden;
}

.login-card form {
    display: grid;
    gap: 1rem;
}

.login-card label {
    font-weight: 700;
    color: #0f172a;
}

.password-wrapper {
    position: relative;
}

.login-card input {
    width: 100%;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 1.15rem 1.2rem;
    font-size: 1rem;
    color: #0f172a;
    background: #f8fafc;
}

.password-wrapper input {
    padding-right: 6.5rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.9rem;
    transform: translateY(-50%);
    border: none;
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.2s ease;
}

.password-toggle:hover,
.password-toggle:focus {
    background: rgba(15, 23, 42, 0.14);
}

.login-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.chat-section {
    padding: 3rem 1rem 4rem;
    min-height: calc(100vh - 130px);
    background: #f4f7fb;
}

.chat-card {
    max-width: 980px;
    margin: 0 auto;
    background: rgb(0, 49, 164);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.18);
}

.chat-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.chat-title {
    margin: 0;
    font-size: 2.25rem;
    color: #000000;
}

.chat-description {
    margin: 0.35rem 0 0;
    color: #f9f4f4;
    line-height: 1.7;
    max-width: 760px;
}

.chat-count {
    color: #f9f4f4;
    font-size: 0.95rem;
}

.chat-delete-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chat-delete-button {
    border: none;
    background: #dc2626;
    color: white;
    border-radius: 18px;
    padding: 0.95rem 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.chat-delete-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #ef4444;
}

.chat-delete-hint {
    color: #475569;
    font-size: 0.95rem;
}

.message-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.75rem;
}

.message-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    background: white;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.message-select input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    margin: 0;
}

.message-select span {
    width: 100%;
    height: 100%;
    display: block;
}

.message-select input:checked + span {
    background: #0f172a;
    mask: url('data:image/svg+xml,%3Csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath fill="white" d="M20.3 5.5L9 16.8 3.7 11.5l1.4-1.4 3.9 3.9L18.9 4.1z"/%3E%3C/svg%3E') center / contain no-repeat;
    -webkit-mask: url('data:image/svg+xml,%3Csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath fill="white" d="M20.3 5.5L9 16.8 3.7 11.5l1.4-1.4 3.9 3.9L18.9 4.1z"/%3E%3C/svg%3E') center / contain no-repeat;
}

.chat-messages {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 24px;
    min-height: 360px;
    max-height: 520px;
    overflow-y: auto;
    padding: 1rem;
    display: grid;
    gap: 1rem;
}

.chat-message {
    background: white;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    padding: 1rem 1.1rem;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.message-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
    font-size: 0.92rem;
    color: #475569;
}

.message-user {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    color: #0f172a;
}

.message-avatar {
    display: inline-flex;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #d1d5db;
    flex-shrink: 0;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.message-time {
    opacity: 0.7;
}

.chat-form {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.chat-form textarea {
    width: 100%;
    min-height: 140px;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 1.2rem;
    font-size: 1rem;
    background: #f8fafc;
    resize: vertical;
}

.chat-form textarea:focus {
    outline: none;
    border-color: #2f7dff;
    box-shadow: 0 0 0 4px rgba(47, 125, 255, 0.12);
}

.chat-submit {
    border: none;
    background: #0f172a;
    color: white;
    border-radius: 18px;
    padding: 1rem 1.4rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: fit-content;
    align-self: flex-end;
}

.chat-submit:hover {
    background: #1e293b;
}

@media (max-width: 720px) {
    .chat-topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

.login-button,
.secondary-button {
    border-radius: 18px;
    padding: 1rem 1.3rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
}

.login-button {
    border: none;
    background: #0f172a;
    color: white;
    cursor: pointer;
}

.login-button:hover {
    background: #1e293b;
}

.secondary-button {
    background: transparent;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.16);
}

.secondary-button:hover {
    background: rgba(15, 23, 42, 0.04);
}

.profile-card {
    background: white;
    border: 1px solid rgba(31, 41, 55, 0.08);
    border-radius: 24px;
    padding: 1.75rem;
    padding-bottom: 9rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 520px;
}

.profile-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
}

.profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1.25rem;
    background: #e2e8f0;
    display: grid;
    place-items: center;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-content h2 {
    margin: 0;
    font-size: 1.35rem;
}

.profile-description {
    margin: 0.75rem 0 1.25rem;
    color: #475569;
    line-height: 1.6;
    min-height: 4.5rem;
}

.profile-card.opened .profile-description {
    display: none;
}

.profile-details {
    display: none;
    margin-top: 1rem;
    color: #334155;
    line-height: 1.7;
}

.profile-card.opened .profile-details {
    display: block;
}

.action-area {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.toggle-button {
    background-color: #01226d;
    border: none;
    color: white;
    padding: 0.85rem 1.3rem;
    border-radius: 999px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.toggle-button:hover,
.toggle-button:focus {
    background-color: #0046e9;
}

.hidden {
    display: none;
}

.site-footer {
    padding: 1.5rem 1rem;
    text-align: center;
    color: #64748b;
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    .site-header h1 {
        font-size: 2rem;
    }
    .profile-card {
        padding: 1.5rem;
    }
}
