/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PT Serif', Georgia, Times, serif;
    line-height: 1.6;
    color: #999;
    background-color: #fff;
}

body p {
    line-height: 1.8em;
    margin-bottom: 20px;
}

a {
    color: #adcfb7;
    text-decoration: none;
}

a:hover {
    color: #cab7b1;
}

img {
    max-width: 100%;
    height: auto;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Container */
.container {
    max-width: 840px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 20px 0 40px;
    max-width: 840px;
    margin: 0 auto;
}

.header .logo {
    height: 170px;
    width: auto;
    margin-bottom: 15px;
}

.header h1 {
    color: #b4dfd3;
    font-family: Georgia, Times, serif;
    font-style: italic;
    font-size: 1.6em;
    font-weight: 400;
    text-transform: none;
    padding-top: 30px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.2em;
}

h1 {
    font-size: 1.6em;
    color: #adcfb7;
    font-weight: 400;
}

h2 {
    font-size: 1.4em;
    color: #888888;
    font-weight: 400;
    margin-bottom: 15px;
}

h3 {
    font-size: 1.2em;
    color: #888888;
    font-weight: 400;
    margin-bottom: 15px;
}

h4 {
    font-size: 1.2em;
    color: #cab7b1;
    font-weight: 400;
}

h5, h6 {
    font-size: 1em;
    color: #666;
    font-weight: 700;
}

/* Signup Section */
.signup-section {
    margin-top: 20px;
    padding: 35px 20px 20px;
    background-color: #fce2d3;
    text-transform: uppercase;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#email {
    display: block;
    float: left;
    width: 60%;
    min-height: 98px;
    border-right: 1px solid white;
    padding-left: 52px;
}

.signup-form {
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

#email-input {
    width: 300px;
    border: 1px solid #ccc;
    color: #888;
    padding: 10px 12px;
    font-size: 1em;
    font-family: 'Montserrat', sans-serif;
}

.submit-btn {
    background: #666666;
    color: white;
    border: none;
    width: 100px;
    height: 40px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    margin-left: 10px;
    cursor: pointer;
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    text-transform: none;
}

.form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Book Previews */
.book-previews {
    margin-top: 20px;
    text-transform: none;
}

.book-previews p {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.preview-books {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.preview-books img {
    width: 60px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.preview-books img:hover {
    transform: scale(1.05);
}

/* Social Connect */
.social-connect {
    width: 33%;
    float: right;
    text-align: center;
    padding-top: 10px;
}

.social-connect h3 {
    margin-bottom: 20px;
    font-size: 1.1em;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-links a {
    display: block;
    transition: transform 0.3s ease;
}

.social-links a:hover {
    transform: scale(1.1);
}

.social-links img {
    width: 40px;
    height: 40px;
}

/* Success Section */
.success-section {
    margin-top: 50px;
    margin-bottom: 50px;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.free-books h2 {
    text-transform: uppercase;
    text-align: center;
    margin-top: 30px;
    margin-bottom: 50px;
}

.book-downloads {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.book-download {
    display: block;
    flex: 1;
    text-decoration: none;
    text-align: center;
    transition: transform 0.3s ease;
    position: relative;
}

.book-download:hover {
    transform: translateY(-5px);
}

.book-download img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin-bottom: 10px;
}

.download-label {
    display: block;
    background: #b4dfd3;
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 14px;
    padding: 8px 15px;
}

.book-download:hover .download-label {
    background: #9fd4c4;
}

.download-note {
    font-size: 12px;
    color: #666;
    font-style: italic;
    text-transform: none;
}

/* Privacy Notice */
.privacy-notice {
    margin-top: 8px;
    text-align: center;
}

.privacy-notice p {
    font-size: 12px;
    color: #ccc;
    line-height: 1.4;
    margin: 0 10px;
}

.privacy-notice a {
    color: #b4dfd3;
    text-decoration: none;
}

.privacy-notice a:hover {
    text-decoration: underline;
}

/* Browse Section */
.browse-section {
    margin: 40px 0;
    text-align: center;
}

.browse-section h2 {
    margin-bottom: 30px;
    font-size: 1.4em;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(4, 188px);
    gap: 20px;
    max-width: 832px;
    margin: 0 auto;
    justify-content: center;
}

.book-item a {
    display: block;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.book-item a:hover {
    transform: scale(1.05);
}

.book-item img {
    width: 188px;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: inherit;
}

.book-item a:focus {
    outline: 2px solid #b4dfd3;
    outline-offset: 2px;
    border-radius: 8px;
}

/* About Section */
.about-section {
    margin: 40px 0;
    text-align: center;
}

.about-amazon-books {
    text-align: center;
    margin-bottom: 20px;
}

.about-amazon-books img {
    width: 175px;
    height: auto;
}

.about-section .leaf {
    padding-top: 20px;
}

.about-section h2 {
    text-align: center;
    text-transform: uppercase;
    margin-top: 20px;
}

.about-section p {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 20px;
}

.about-section hr {
    margin: 20px auto;
    max-width: 700px;
    border: none;
    border-top: 1px solid #ddd;
}

.about-section a img {
    margin-top: 10px;
    border-radius: 50%;
}

/* Footer */
.footer {
    padding-top: 20px;
    height: 70px;
    border-top: 1px solid #eee;
}

.footer-contact {
    float: left;
    padding-top: 10px;
    font-size: 0.9em;
    font-family: 'Montserrat', sans-serif;
    color: #b5dfd2;
}

.footer-contact a {
    color: #b5dfd2;
}

.footer-social {
    float: right;
}

.footer-social img {
    width: 37px;
    height: auto;
}

/* Loading States */
.btn-loading {
    display: inline-block;
}

.submit-btn:disabled .btn-text {
    display: none;
}

.submit-btn:disabled .btn-loading {
    display: inline-block;
}

/* Focus States for Accessibility */
.submit-btn:focus,
#email-input:focus {
    outline: 2px solid #b4dfd3;
    outline-offset: 2px;
}

.book-download:focus,
.social-links a:focus {
    outline: 2px solid #b4dfd3;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Animation for success state */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-section.show {
    animation: fadeIn 0.5s ease-out;
}