/* General layout */
html {
    min-height: 100%;
    background: #1a1a1a;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    color: #ffffff;
}

main {
    width: 100%;
    max-width: 700px;
}

/* Logo */
.form-logo {
    max-width: 150px;
    width: 100%;
    height: auto;
    display: block;
    margin: calc(2rem - 5px) auto calc(1rem - 5px);
}

/* Form container */
.form-container {
    background: linear-gradient(135deg, #2d2d2d 0%, #252525 100%);
    border: 2px solid #3d3d3d;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 2rem 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.form-container>* {
    min-width: 0;
}

/* Header */
header h1 {
    margin: 0 0 1rem 0;
    font-size: 1.75rem;
    text-align: left;
}

/* Intro paragraph */
.form-container>p:first-of-type {
    margin-top: 0;
    margin-bottom: 0rem;
    line-height: 1.5;
}

.form-container p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Form styling */
#cabinForm {
    margin-top: 1rem;
}

/* Labels and selects */
label {
    display: block;
    margin-top: 1rem;
    font-weight: 500;
}

select,
input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    margin-top: calc(0.25rem + 5px);
    border: 1px solid #3d3d3d;
    border-radius: 4px;
    background: #1a1a1a;
    color: #ffffff;
    appearance: menulist;
    -webkit-appearance: menulist;
    font-family: inherit;
    box-sizing: border-box;
}

input[type="number"] {
    appearance: textfield;
    -webkit-appearance: textfield;
}

input[type="text"] {
    appearance: textfield;
    -webkit-appearance: textfield;
}

select::placeholder,
input[type="number"]::placeholder,
input[type="text"]::placeholder {
    color: #909090;
    opacity: 1;
}

select::-webkit-input-placeholder,
input[type="number"]::-webkit-input-placeholder,
input[type="text"]::-webkit-input-placeholder {
    color: #909090;
    opacity: 1;
}

select::-moz-placeholder,
input[type="number"]::-moz-placeholder,
input[type="text"]::-moz-placeholder {
    color: #909090;
    opacity: 1;
}

/* Submit button */
button {
    margin-top: 2rem;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    color: white;
    background-color: #ED335F;
    cursor: pointer;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    font-family: inherit;
    font-weight: 600;
    box-sizing: border-box;
}

button:hover {
    background-color: #D12347;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Begin button (styled link) */
.begin-button {
    display: block;
    margin-top: 2rem;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    color: white;
    background-color: #ED335F;
    cursor: pointer;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    font-family: inherit;
    font-weight: 600;
    box-sizing: border-box;
    text-decoration: none;
    text-align: center;
}

.begin-button:hover {
    background-color: #D12347;
}

/* Result message */
#resultMessage {
    margin-top: 1rem;
    margin-bottom: 0rem;
    min-height: 1.5em;
    transition: color 0.2s ease;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: anywhere;
    font-family: inherit;
}

.hidden {
    display: none;
}

/* Hint section */
.hint-section {
    margin-top: 1rem;
    width: 100%;
}

.hint-toggle {
    margin-top: 2rem;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid #ED335F;
    border-radius: 6px;
    color: #ffffff;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 600;
}

.hint-toggle:hover {
    background-color: rgba(237, 51, 95, 0.1);
    color: #ffffff;
    border-color: #D12347;
}

.hint-content {
    margin-top: 1rem;
    padding-left: 1rem;
}

/* Cabin list styling */
.cabin-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.cabin-list li {
    margin-bottom: 0.5rem;
}

.cabin-list ul {
    list-style: none;
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

/* Cabin buttons */
.cabin-list button.cabin-toggle {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
    border: 2px solid #3d3d3d;
    border-radius: 5px;
    background: #3d3d3d;
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.cabin-list button.cabin-toggle:hover {
    background: #4a4a4a;
    border-color: #ED335F;
}

/* Final solution button styling */
.cabin-list button.final-solution-toggle {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.cabin-list button.final-solution-toggle:hover {
    background: #c82333;
    border: 1px solid #c82333;
}

/* Individual hint buttons */
.single-hint-toggle {
    margin-top: 0.5rem;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
    border: 1px solid #3d3d3d;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    font-weight: 500;
    color: #ffffff;
    transition: all 0.3s ease;
}

.single-hint-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ED335F;
}

/* Indent hint buttons only when inside cabin-hints */
.cabin-hints .single-hint-toggle {
    margin-left: 1rem;
    width: calc(100% - 1rem);
}

/* Indent hint text inside cabin-hints */
.cabin-hints .single-hint {
    margin-left: 2rem;
}

/* Indent buttons inside solution-section */
.solution-section .single-hint-toggle {
    margin-left: 1rem;
    width: calc(100% - 1rem);
}

/* Indent hint text inside solution-section */
.solution-section .single-hint {
    margin-left: 2rem;
}

/* Solution button styling */
.single-hint-toggle.solution-toggle {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.single-hint-toggle.solution-toggle:hover {
    background: #c82333;
    border: 1px solid #c82333;
}

/* Hint text */
.single-hint {
    margin-left: 1rem;
    margin-top: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid #ED335F;
    background: rgba(237, 51, 95, 0.1);
    color: #ffffff;
    border-radius: 4px;
    font-weight: normal;
    font-size: 0.95rem;
}

/* Case closed image */
.case-closed-image {
    display: block;
    margin: 0 auto 20px auto;
    max-width: min(80%, 250px);
    height: auto;
}

/* Responsive */
@media (max-width: 600px) {
    .form-container {
        padding: 1.5rem;
    }
}