/* ===========================
   Form & Table Styles
   =========================== */

/* === Tournament Form === */
.tournament-form {
    max-width: 600px;
    margin-top: 2rem;
}

.form-field {
    display: flex;
    align-items: center;
    padding-bottom: 2.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--bx-border);
}

.form-field label {
    flex: 0 0 180px;
    text-align: right;
    padding-right: 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--bx-text-on-dark);
    white-space: nowrap;
}

.form-field input {
    flex: 1;
}

.form-field .required {
    color: #d63638;
}

.form-field input {
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    background-color: var(--bx-dark-light) !important;
    color: var(--bx-text-on-dark) !important;
    border: 1px solid var(--bx-border) !important;
    border-radius: 6px;
    transition: border-color 0.2s;
}

.form-field input:focus {
    outline: none;
    border-color: var(--bx-primary) !important;
    box-shadow: 0 0 0 2px rgba(232, 123, 53, 0.2) !important;
}

.form-submit {
    display: inline-block;
    margin-left: 180px;
    padding: 0.65rem 1.5rem;
    background: var(--bx-primary) !important;
    color: #fff !important;
    font-size: 1rem;
    font-weight: 600;
    border: none !important;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.form-submit:hover {
    background: var(--bx-primary-hover) !important;
}

/* === Messages === */
.form-message {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 6px;
}

.form-success {
    background: rgba(92, 184, 92, 0.15);
    border: 1px solid var(--bx-success);
    color: #8fdf8f;
}

.form-success a {
    color: var(--bx-primary);
}

.form-errors {
    background: rgba(214, 54, 56, 0.15);
    border: 1px solid #d63638;
    color: #f09090;
}

.form-errors ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.submission-summary {
    margin-top: 0.75rem;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 1rem;
}

.submission-summary dt {
    font-weight: 600;
}

.submission-summary dd {
    margin: 0;
}

/* === Tournament List Table === */
.tournament-list {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}

.tournament-list th,
.tournament-list td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--bx-border);
    color: var(--bx-text-on-dark);
}

.tournament-list thead th {
    background: var(--bx-dark-light);
    font-weight: 700;
    font-size: 0.95rem;
}

.tournament-list tbody tr:hover {
    background: var(--bx-dark-light);
}

/* === Login Form === */
.login-form-wrapper {
    display: flex;
    justify-content: center;
    padding: 3rem 1rem;
}

.login-form-box {
    width: 100%;
    max-width: 400px;
    background-color: var(--bx-dark-mid);
    border: 1px solid var(--bx-border);
    border-radius: 8px;
    padding: 2.5rem 2rem;
}

.login-form-box h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--bx-primary) !important;
}

.login-form .form-field {
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 0;
    margin-bottom: 1.25rem;
    border-bottom: none;
}

.login-form .form-field label {
    flex: none;
    text-align: left;
    padding-right: 0;
    margin-bottom: 0.35rem;
}

.login-form .form-field-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    cursor: pointer;
}

.login-form .form-field-checkbox input[type="checkbox"] {
    width: auto;
    flex: none;
    accent-color: var(--bx-primary);
}

.login-form .form-submit {
    width: 100%;
    margin-left: 0;
    text-align: center;
    margin-top: 0.5rem;
}

.login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 1.25rem;
    font-size: 0.9rem;
}

.login-links a {
    color: var(--bx-text-muted) !important;
}

.login-links a:hover {
    color: var(--bx-primary) !important;
}

/* === Mobile === */
@media (max-width: 480px) {
    .form-field {
        flex-direction: column;
        align-items: stretch;
    }

    .form-field label {
        text-align: left;
        flex: none;
        padding-right: 0;
        margin-bottom: 0.35rem;
    }

    .form-submit {
        margin-left: 0;
    }
}

@media (max-width: 600px) {
    .tournament-list thead {
        display: none;
    }

    .tournament-list tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--bx-border);
        border-radius: 6px;
        padding: 0.75rem;
        background: var(--bx-dark-mid);
    }

    .tournament-list td {
        display: block;
        border: none;
        padding: 0.25rem 0;
    }

    .tournament-list td::before {
        content: attr(data-label);
        font-weight: 600;
        margin-right: 0.5rem;
    }
}
