
main {
    --section-background: #fff;
    --section-border: #d9e3d3;
    --text-h1: #2f4633;
    --text-h2: #4b6845;
    --text-h3: #35563b;
    --card-background: #f3f5f0;
    
    --button-background-green: #4b6845;
    --button-hover-green: #273f2b;
    --button-background-soft: #dad6be;
    --button-hover-soft: #a59a64;
    --focus-ring: rgba(75, 104, 69, 0.15);

    max-width: 900px;
    margin: 40px auto 60px;
    padding: 0 20px;
}

main h1 {
    color: var(--text-h1);
    margin-bottom: 2rem;
    text-align: center;
}

main h2 {
    color: var(--text-h2);
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5ece2;
    padding-bottom: 10px;
}

main h3 {
    color: var(--text-h3);
    margin: 0 0 12px;
}

main p {
    font-size: 1rem;
    margin: 10px 0;
}

main label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-h3);
}

.section-grid,
.section-grid-center {
    background: var(--section-background);
    border: 1px solid var(--section-border);
    border-radius: 8px;
    padding: 24px 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.section-grid-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* form */
.form-border,
.form-no-border {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
}

.form-border {
    background: var(--section-background);
    border: 1px solid var(--section-border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.form-border > div,
.form-no-border > div { /* only direct child elements */
    margin-bottom: 20px;
}

.form-border > div:last-of-type,
.form-no-border > div:last-of-type {
    margin-bottom: 28px;
}

/* error message */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 500px;
    margin: 0 auto 20px;
    padding: 14px 16px;
    background: #fdeaea;
    border: 1px solid #e4b8b8;
    border-radius: 8px;
    color: #9a2e2e;
}

.error-message h1 {
    margin-top: 0;
    color: #8f3030;
}

/* success message */
.success-message {
    background: #e8f5e9;
    color: #2e6b35;
    border: 1px solid #8bc48f;
    border-left: 5px solid #3f8f45;
    padding: 14px 16px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: 600;
}




/* -----------------------------login & register----------------------------- */
main input[type="email"],
main input[type="password"],
main input[type="text"] {
    font-size: 1rem;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cfd8ca;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

main button[type="submit"],
.buy-button,
.go-to-button {
    font-size: 1rem;
    text-decoration: none;
    font-weight: 600;
    padding: 12px 20px;
    margin-top: 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

main button[type="submit"],
.buy-button {
    color: #fff;
    background: var(--button-background-green);
    border: none;
}

main button[type="submit"] {
    display: block;
    width: 100%;
}

.buy-button,
.go-to-button {
    display: inline-block;
}

main button[type="submit"]:hover,
.buy-button:hover {
    background: var(--button-hover-green);
}

.go-to-button {
    color: #444;
    background: var(--button-background-soft);
    border: 1px solid #d6d6d6;
}

.go-to-button:hover {
    background: var(--button-hover-soft);
}

main > p {
    margin-top: 30px;
    text-align: center;
}

main > p a {
    color: var(--text-h2);
    text-decoration: none;
    font-weight: 600;
}

main > p a:hover {
    text-decoration: underline;
}

.required {
    color: #c0392b;
    font-weight: 700;
    margin-left: 4px;
}

/* Browser validation */
main input:invalid:not(:placeholder-shown) {
    border-color: #c0392b;
    background-color: #fff7f7;
}

main input:invalid:focus {
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

main input:valid {
    border-color: #b8d4b0;
}



/* -----------------------------account----------------------------- */
.edition-bought {
    background: var(--card-background);
    border: 1px solid #dfe8da;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 18px;
    transition: box-shadow 0.2s ease;
}

.edition-bought:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.edition-bought p {
    margin: 6px 0;
}

.edition-bought:last-child {
    margin-bottom: 0;
}

/* Purchase current edition */
.current-edition {
    background: #fff9e8;
    border-color: #e6c86a;
}



/* -----------------------------Payment processing----------------------------- */
.go-to-actions {
    display: flex;
    gap: 48px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.processing-box {
    background: #fff9e8;
    border: 1px solid #e6c86a;
    border-radius: 10px;
    padding: 30px;
    max-width: 600px;
    margin: 40px auto;
    text-align: center;
}






/* -----------------------------modify account----------------------------- */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: #555;
    padding: 4px;
}

.toggle-password:hover {
    color: #222;
}




