:root {
    --black-color: #000000;
    --white-color: #ffffff;
    --main-section-bg-color: #EFF1F7;
    --text-color-1: #9E9AA8;
    --text-color-2: #34313D;
    --button-color: #2BD0D0;
    --button-hover-color: #9AE3E3;
    --main-short-section-bg-color: #3A3054;
    --warning-text-color: #F46363;
    --footer-bg-color: #232127;
}

/* ========================
   GLOBAL
   ======================== */
html {
    box-sizing: border-box;
    height: 100%;
    scroll-behavior: smooth;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

*:focus-visible {
    outline: 2px dashed var(--button-color);
    outline-offset: 3px;
}

ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: var(--text-color-1);
}

h1, h2, h3, p {
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 0;
    margin: 0;
    font-family: "Poppins", "Arial", sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 26px;
    background-color: var(--white-color);
    color: var(--text-color-1);
    overflow-x: hidden;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    border: 0;
    padding: 0;
    clip: rect(0 0 0 0);
    overflow: hidden;
}

/* ========================
   PAGE LOADER
   ======================== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--white-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--main-section-bg-color);
    border-top-color: var(--button-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================
   CONTAINER
   ======================== */
.container {
    width: 100%;
    max-width: 1150px;
    padding-left: 20px;
    padding-right: 20px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================
   HEADER
   ======================== */
.site-header {
    background-color: var(--white-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}

.site-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    padding-bottom: 24px;
}

.site-nav {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
}

.site-header-logo {
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}

.site-header-logo:hover {
    opacity: 0.8;
}

.site-header-logo:active {
    opacity: 0.6;
}

/* Burger Menu */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 200;
}

.burger-line {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text-color-1);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.burger-menu.active .burger-line:nth-child(1) {
    transform: translateY(9.5px) rotate(45deg);
}

.burger-menu.active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-menu.active .burger-line:nth-child(3) {
    transform: translateY(-9.5px) rotate(-45deg);
}

/* Nav Content */
.nav-content {
    display: flex;
    align-items: center;
    width: 100%;
    margin-left: 45px;
    justify-content: space-between;
}

.site-nav-list {
    display: flex;
    gap: 29px;
}

.site-nav-item a {
    font-weight: 700;
    line-height: 23px;
    transition: color 0.3s ease;
}

.site-nav-item a:hover {
    color: var(--text-color-2);
}

.site-nav-item a:active {
    opacity: 0.6;
}

.sign-up-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sign-up-link {
    font-weight: 700;
    line-height: 23px;
    transition: color 0.3s ease;
}

.sign-up-link:hover {
    color: var(--text-color-2);
}

.sign-up-link:active {
    opacity: 0.6;
}

.sign-up-button {
    color: var(--white-color);
    padding: 8px 24px;
    border: 2px solid var(--button-color);
    background-color: var(--button-color);
    border-radius: 28px;
    font-weight: 700;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.sign-up-button:hover {
    color: var(--button-color);
    background-color: transparent;
}

.sign-up-button:active {
    opacity: 0.6;
}

/* ========================
   HERO SECTION
   ======================== */
.hero-section {
    overflow: hidden;
}

.hero-section-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding-top: 40px;
    padding-bottom: 120px;
}

.hero-section-info-wrapper {
    z-index: 3;
    max-width: 564px;
    flex-shrink: 0;
}

.hero-section-info-wrapper h1 {
    font-size: 80px;
    font-weight: 700;
    line-height: 90px;
    letter-spacing: -2px;
    color: var(--text-color-2);
    margin-bottom: 5px;
}

.hero-section-info-wrapper p {
    font-size: 22px;
    line-height: 36px;
    letter-spacing: 0.15px;
    margin-bottom: 38px;
}

/* Primary Button (shared style) */
.btn-primary {
    display: inline-block;
    color: var(--white-color);
    font-size: 20px;
    font-weight: 700;
    line-height: 30px;
    border: 2px solid var(--button-color);
    padding: 12px 40px;
    background-color: var(--button-color);
    border-radius: 28px;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: center;
}

.btn-primary:hover {
    color: var(--button-color);
    background-color: transparent;
}

.btn-primary:active {
    opacity: 0.6;
}

.hero-section-img {
    position: absolute;
    left: calc(50% + 30px);
    top: 1%;
}

/* ========================
   MAIN SECTION
   ======================== */
.main-section {
    background-color: var(--main-section-bg-color);
    flex-grow: 1;
}

/* URL Shortener Form */
.url-shortener-wrapper {
    margin-bottom: 24px;
}

.url-shortener-form {
    background-image: url(../img/main-shortly-bg-img.svg);
    background-size: cover;
    background-position: center;
    background-color: var(--main-short-section-bg-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -84px;
    padding: 52px 64px;
    border-radius: 10px;
    gap: 24px;
}

.input-wrapper {
    position: relative;
    flex-grow: 1;
}

.url-shortener-input {
    width: 100%;
    border: 3px solid transparent;
    padding: 14px 30px;
    border-radius: 10px;
    background-color: var(--white-color);
    color: var(--text-color-2);
    font-size: 20px;
    line-height: 36px;
    letter-spacing: 0.15px;
    transition: border-color 0.3s ease;
}

.url-shortener-input::placeholder {
    color: rgba(52, 49, 61, 0.5);
}

.url-shortener-input.error {
    border-color: var(--warning-text-color);
    color: var(--warning-text-color);
}

.url-shortener-input.error::placeholder {
    color: var(--warning-text-color);
    opacity: 0.7;
}

.warning-text {
    display: none;
    position: absolute;
    margin-top: 8px;
    color: var(--warning-text-color);
    font-style: italic;
    font-size: 16px;
    line-height: 18px;
    letter-spacing: 0.11px;
}

.warning-text.visible {
    display: block;
}

.url-shortener-button {
    flex-shrink: 0;
    border: 2px solid var(--button-color);
    cursor: pointer;
    padding: 16px 38px;
    border-radius: 10px;
    background-color: var(--button-color);
    color: var(--white-color);
    font-size: 20px;
    font-weight: 700;
    line-height: 30px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
    min-width: 188px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.url-shortener-button:hover {
    border-color: var(--white-color);
    background-color: transparent;
}

.url-shortener-button:active {
    opacity: 0.6;
}

/* Button Loader */
.btn-loader {
    display: none;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: var(--white-color);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.url-shortener-button.loading .btn-text {
    display: none;
}

.url-shortener-button.loading .btn-loader {
    display: block;
}

/* ========================
   URL HISTORY
   ======================== */
.url-history-wrapper {
    display: none;
}

.url-history-wrapper.open {
    display: block;
}

.url-history-card {
    max-width: 1150px;
    padding-left: 20px;
    padding-right: 20px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 16px;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.url-history-card:last-child {
    margin-bottom: 80px;
}

.url-history-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--white-color);
    padding: 16px 24px 16px 32px;
    border-radius: 5px;
}

.url-history-long-url {
    color: var(--text-color-2);
    font-size: 20px;
    line-height: 36px;
    letter-spacing: 0.15px;
    word-break: break-all;
}

.shorter-type-of-url {
    display: flex;
    align-items: center;
    gap: 24px;
}

.shorter-type-of-url p {
    color: var(--button-color);
    font-size: 20px;
    line-height: 36px;
    letter-spacing: 0.15px;
}

.copy-button {
    border: 2px solid transparent;
    padding: 8px 29px;
    background-color: var(--button-color);
    color: var(--white-color);
    font-size: 15px;
    font-weight: 700;
    line-height: 23px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    min-width: 100px;
}

.copy-button:hover {
    color: var(--button-color);
    border-color: var(--button-color);
    background-color: var(--white-color);
}

.copy-button:active {
    opacity: 0.6;
}

.copy-button.copied {
    background-color: var(--main-short-section-bg-color);
    border-color: transparent;
}

/* ========================
   STATISTICS SECTION
   ======================== */
.about-site-section-container {
    margin-top: 120px;
    padding-bottom: 120px;
}

.about-site-section-header {
    margin-bottom: 56px;
    text-align: center;
}

.about-site-section-header h2 {
    color: var(--text-color-2);
    font-size: 40px;
    font-weight: 700;
    line-height: 48px;
    letter-spacing: -1px;
    margin-bottom: 18px;
}

.about-site-section-header p {
    font-size: 18px;
    font-weight: 500;
    line-height: 32px;
    letter-spacing: 0.12px;
    max-width: 540px;
    margin: 0 auto;
}

/* Cards */
.about-site-section-cards-wrapper {
    display: flex;
    align-items: flex-start;
    position: relative;
}

.card-wrapper {
    position: relative;
    padding: 77px 32px 41px;
    background-color: var(--white-color);
    border-radius: 5px;
    flex: 1;
}

.card-wrapper:nth-child(3) {
    margin-top: 44px;
}

.card-wrapper:nth-child(5) {
    margin-top: 88px;
}

.card-icon-wrapper {
    position: absolute;
    top: -44px;
    left: 32px;
    width: 88px;
    height: 88px;
    background-color: var(--main-short-section-bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-connector {
    width: 30px;
    height: 8px;
    background-color: var(--button-color);
    flex-shrink: 0;
    align-self: center;
    margin-top: 44px;
}

.card-wrapper h3 {
    color: var(--text-color-2);
    font-size: 22px;
    font-weight: 700;
    line-height: 33px;
    margin-bottom: 12px;
}

/* ========================
   CTA
   ======================== */
.cta {
    background-color: var(--main-short-section-bg-color);
    background-image: url(../img/main-shortly-bg-img.svg);
    background-size: cover;
    background-position: center;
    padding-top: 57px;
    padding-bottom: 57px;
}

.cta-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cta-container h2 {
    color: var(--white-color);
    font-size: 40px;
    font-weight: 700;
    line-height: 48px;
    letter-spacing: -1px;
    text-align: center;
    margin-bottom: 32px;
}

/* ========================
   FOOTER
   ======================== */
.site-footer {
    background-color: var(--footer-bg-color);
    padding-top: 72px;
    padding-bottom: 72px;
}

.site-footer-container {
    display: flex;
    justify-content: space-between;
}

.site-footer-logo {
    flex-shrink: 0;
}

.site-footer-logo img {
    transition: opacity 0.3s ease;
}

.site-footer-logo img:hover {
    opacity: 0.8;
}

.site-footer-nav {
    display: flex;
    gap: 50px;
}

.site-footer-item-heading {
    margin-bottom: 22px;
}

.site-footer-nav-heading {
    color: var(--white-color);
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    letter-spacing: -0.25px;
}

.site-footer-nav-link {
    line-height: 23px;
    letter-spacing: -0.23px;
    transition: color 0.3s ease;
}

.site-footer-nav-link:hover {
    color: var(--button-color);
}

.site-footer-item:not(:last-child) {
    margin-bottom: 10px;
}

.socials-wrapper-inner {
    display: flex;
    align-items: center;
    gap: 24px;
}

.socials-wrapper-inner a {
    transition: opacity 0.3s ease;
}

.socials-wrapper-inner a:hover {
    opacity: 0.7;
}

/* ========================
   RESPONSIVE - TABLET (768px)
   ======================== */
@media (max-width: 768px) {
    .hero-section-container {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: 20px;
        padding-bottom: 80px;
    }

    .hero-section-img {
        position: relative;
        left: auto;
        top: auto;
        max-width: 100%;
        margin-bottom: 40px;
    }

    .hero-section-info-wrapper {
        max-width: 100%;
        align-items: center;
    }

    .hero-section-info-wrapper h1 {
        font-size: 46px;
        line-height: 54px;
        letter-spacing: -1px;
    }

    .hero-section-info-wrapper p {
        font-size: 18px;
        line-height: 30px;
    }

    .url-shortener-form {
        flex-direction: column;
        padding: 32px;
        margin-top: -48px;
    }

    .url-shortener-input {
        font-size: 16px;
        padding: 12px 20px;
    }

    .url-shortener-button {
        width: 100%;
        min-width: auto;
    }

    .url-history-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }

    .url-history-long-url {
        font-size: 16px;
        line-height: 28px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--main-section-bg-color);
    }

    .shorter-type-of-url {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding-top: 12px;
    }

    .shorter-type-of-url p {
        font-size: 16px;
        line-height: 28px;
    }

    .copy-button {
        width: 100%;
        text-align: center;
    }

    .about-site-section-cards-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .card-wrapper {
        width: 100%;
        max-width: 400px;
        text-align: center;
    }

    .card-wrapper:nth-child(3),
    .card-wrapper:nth-child(5) {
        margin-top: 0;
    }

    .card-icon-wrapper {
        left: 50%;
        transform: translateX(-50%);
    }

    .card-connector {
        width: 8px;
        height: 30px;
        margin-top: 0;
    }

    .about-site-section-header h2 {
        font-size: 28px;
        line-height: 36px;
    }

    .about-site-section-header p {
        font-size: 16px;
        line-height: 28px;
    }

    .cta-container h2 {
        font-size: 28px;
        line-height: 36px;
    }

    .site-footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 40px;
    }

    .site-footer-nav {
        flex-direction: column;
        gap: 32px;
    }

    .socials-wrapper-inner {
        justify-content: center;
    }
}

/* ========================
   RESPONSIVE - MOBILE (576px)
   ======================== */
@media (max-width: 576px) {
    /* Burger visible */
    .burger-menu {
        display: flex;
    }

    .nav-content {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        left: 20px;
        right: 20px;
        background-color: var(--main-short-section-bg-color);
        border-radius: 10px;
        padding: 32px 24px;
        flex-direction: column;
        align-items: center;
        margin-left: 0;
        z-index: 150;
        box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    }

    .nav-content.open {
        display: flex;
    }

    .site-nav {
        position: relative;
    }

    .site-nav-list {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        margin-bottom: 24px;
        padding-bottom: 24px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        width: 100%;
    }

    .site-nav-item a {
        color: var(--white-color);
        font-size: 18px;
    }

    .site-nav-item a:hover {
        color: var(--button-color);
    }

    .sign-up-wrapper {
        flex-direction: column;
        width: 100%;
        gap: 16px;
    }

    .sign-up-link {
        color: var(--white-color);
        font-size: 18px;
    }

    .sign-up-link:hover {
        color: var(--button-color);
    }

    .sign-up-button {
        width: 100%;
        text-align: center;
        padding: 12px 24px;
        font-size: 18px;
    }

    /* Hero mobile */
    .hero-section-info-wrapper h1 {
        font-size: 34px;
        line-height: 42px;
    }

    .hero-section-info-wrapper p {
        font-size: 16px;
        line-height: 26px;
    }

    .btn-primary {
        font-size: 18px;
        padding: 10px 32px;
    }

    .url-shortener-form {
        padding: 24px;
    }

    .about-site-section-container {
        margin-top: 80px;
        padding-bottom: 80px;
    }

    .cta {
        padding-top: 40px;
        padding-bottom: 40px;
    }

    .site-footer {
        padding-top: 48px;
        padding-bottom: 48px;
    }
}
