/* Public landing page (index.php) styles.
   Palette matches the rest of the app: teal #5C7E8F (hover #4a6b7a),
   greys #D4DDE2 / #f4f4f4, borders #A2A2A2. */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f4f4f4;
    color: #333;
}

/* ---- Header + account section ---- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #5C7E8F;
    color: white;
    padding: 10px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
}

#account-section {
    position: relative;
    display: flex;
    align-items: center;
}

.account-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    border: none;
    border-radius: 22px;
    padding: 8px 16px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.account-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.account-btn .fa-caret-down {
    font-size: 0.8rem;
}

/* Dropdown shown when signed in */
.account-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    color: #333;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    overflow: hidden;
    z-index: 500;
}

.account-menu.open {
    display: block;
}

.account-menu .menu-userid {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
    color: #777;
}

.account-menu .menu-userid strong {
    display: block;
    color: #333;
    font-size: 1rem;
    margin-top: 2px;
}

.account-menu a,
.account-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 0.95rem;
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

.account-menu a:hover,
.account-menu button:hover {
    background: #f4f4f4;
}

.account-menu .menu-logout {
    color: #b23b3b;
    border-top: 1px solid #eee;
}

/* ---- Main / intro ---- */
main {
    flex: 1;
    padding: 32px 20px 48px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.landing-intro {
    text-align: center;
    margin-bottom: 32px;
}

.landing-intro h2 {
    margin: 0 0 8px;
    font-size: 1.8rem;
    color: #3d5763;
}

.landing-intro p {
    margin: 0;
    color: #666;
}

/* ---- Tool card grid ---- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #D4DDE2;
    border-radius: 10px;
    padding: 24px 20px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    border-color: #5C7E8F;
}

.tool-card .tool-icon {
    font-size: 2rem;
    color: #5C7E8F;
    margin-bottom: 14px;
}

.tool-card h3 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    color: #3d5763;
}

.tool-card p {
    margin: 0;
    font-size: 0.9rem;
    color: #777;
    line-height: 1.4;
}

.login-badge,
.access-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 4px 8px;
    border-radius: 12px;
}

.login-badge {
    background: #eef2f4;
    color: #5C7E8F;
}

/* Shown in place of the lock badge once the user is signed in. */
.access-badge {
    background: #16a34a;
    color: #ffffff;
}

/* ---- Login / register / API-key modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: #fff;
    padding: 24px 28px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    width: 340px;
    max-width: 92vw;
    text-align: center;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-pane {
    display: none;
}

.modal-pane.active {
    display: block;
}

.modal .LoginHeader {
    border-bottom: 1px solid #ddd;
    font-size: 1.4rem;
    font-weight: bold;
    padding-bottom: 14px;
    margin-bottom: 6px;
}

.modal form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
}

.modal input {
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    width: 100%;
}

.modal .LoginButton {
    font-size: 1.1rem;
    height: 44px;
    color: white;
    background-color: #5C7E8F;
    border: none;
    border-radius: 22px;
    cursor: pointer;
    transition: background 0.2s;
}

.modal .LoginButton:hover {
    background-color: #4a6b7a;
}

.modal .switch-row {
    margin-top: 16px;
    font-size: 0.9rem;
    color: #666;
}

.LoginRegisterLinks {
    color: #5C7E8F;
    text-decoration: none;
    cursor: pointer;
    font-weight: bold;
}

.LoginRegisterLinks:hover {
    text-decoration: underline;
}

.modal .apikey-help {
    font-size: 0.85rem;
    color: #5C7E8F;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.2rem;
    }

    main {
        padding: 24px 16px 40px;
    }
}
