:root {
    --bg-dark: #0f172a;
    --bg-darker: #0b1120;
    --bg-light: #f8fafc;
    --accent: #38bdf8;
    --accent-soft: rgba(56, 189, 248, 0.16);
    --text-main: #0f172a;
    --text-muted: #475569;
    --border-color: rgba(15, 23, 42, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-main);
    background: var(--bg-light);
}

.container {
    width: min(1100px, 92vw);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(248, 250, 252, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    height: 100px;
    max-height: 100px;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0;
    padding: 0 2rem 0 40px;
    gap: 2rem;
    height: 100%;
    max-height: 100px;
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    max-height: 50px;
    width: auto;
    display: block;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: var(--text-main);
}

.auth-actions {
    display: flex;
    gap: 0.75rem;
}

.auth-user {
    position: relative;
    display: inline-block;
}

.auth-user summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.05);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-user__avatar-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    cursor: zoom-in;
}

.auth-user__avatar-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #f1f5f9;
}

.auth-user__avatar-placeholder {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.08);
    color: rgba(51, 65, 85, 0.8);
    font-weight: 600;
    text-transform: uppercase;
}

.auth-user__name {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.auth-user summary::-webkit-details-marker {
    display: none;
}

.auth-user summary::after {
    content: '\25BC';
    font-size: 0.7rem;
    color: rgba(30, 41, 59, 0.6);
    transition: transform 0.2s ease;
}

.auth-user summary:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.45);
}

.auth-user[open] summary::after {
    transform: rotate(180deg);
}

.auth-user__menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    box-shadow: 0 20px 40px -25px rgba(15, 23, 42, 0.45);
    padding: 0.75rem 0;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 25;
}

.auth-user__link {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    background: transparent;
    border: none;
    font: inherit;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.auth-user__link:hover {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
}

.auth-user__link--signout {
    color: #dc2626;
}

.auth-user__link--signout:hover {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.auth-user {
    position: relative;
    display: inline-block;
}

.auth-user summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.05);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-user summary:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.45);
}

.auth-user summary::-webkit-details-marker {
    display: none;
}

.auth-user summary::after {
    content: '\25BC';
    font-size: 0.7rem;
    color: rgba(30, 41, 59, 0.6);
    transition: transform 0.2s ease;
}

.auth-user[open] summary::after {
    transform: rotate(180deg);
}

.auth-user__menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    box-shadow: 0 20px 40px -25px rgba(15, 23, 42, 0.45);
    padding: 0.75rem 0;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 25;
}

.auth-user__link {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    background: transparent;
    border: none;
    font: inherit;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.auth-user__link:hover {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
}

.auth-user__link--signout {
    color: #dc2626;
}

.auth-user__link--signout:hover {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.6rem 1.3rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-dark);
    box-shadow: 0 12px 30px -18px rgba(56, 189, 248, 0.75);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px -16px rgba(56, 189, 248, 0.75);
}

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-text {
    background: transparent;
    color: var(--text-muted);
}

.btn-text:hover {
    color: var(--text-main);
}

.hero {
    position: relative;
    overflow: visible;
    min-height: 100vw;
    padding: 6rem 0 6rem;
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.2), transparent 55%), var(--bg-light);
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 100vw;
    aspect-ratio: 1 / 1;
    transform: translateX(-50%);
    background: url('../../img/krajina_reka.png') no-repeat center top;
    background-size: contain;
    opacity: 0.7;
    filter: blur(1px) saturate(0.7);

    z-index: 0;
}

.hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 100vw;
    aspect-ratio: 1 / 1;
    transform: translateX(-50%);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 80%, rgba(100,180,255,0.7) 100%);
    pointer-events: none;
    z-index: 0;
}

.hero__content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 3rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: center;
}

.hero__text h1 {
    font-size: clamp(2.4rem, 4vw, 3.2rem);
    line-height: 1.15;
    margin-bottom: 1.25rem;
}

.hero__text p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.05rem;
    max-width: 540px;
}

.badge {
    display: inline-flex;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.hero__visual {
    display: flex;
    justify-content: center;
}

.hero__card {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.8));
    color: #f8fafc;
    border-radius: 28px;
    padding: 2rem;
    width: min(360px, 100%);
    box-shadow: 0 30px 60px -40px rgba(15, 23, 42, 0.9);
}

.hero__card h2 {
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.project-list {
    list-style: none;
    display: grid;
    gap: 1rem;
}

.project-list__title {
    font-weight: 600;
}

.project-list__meta {
    display: block;
    font-size: 0.9rem;
    color: rgba(226, 232, 240, 0.8);
    margin-top: 0.35rem;
}

.section {
    padding: 4.5rem 0;
    background: var(--bg-light);
}

.section--alt {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section h2 {
    text-align: center;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    margin-bottom: 3rem;
}

.steps {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.step {
    background: #ffffff;
    border-radius: 18px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 35px -30px rgba(15, 23, 42, 0.2);
}

.step__number {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-weight: 700;
    margin-bottom: 1rem;
}

.step h3 {
    margin-bottom: 0.75rem;
}

.step p {
    color: var(--text-muted);
}

.cards-grid {
    display: grid;
    gap: 1.75rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 20px 35px -30px rgba(15, 23, 42, 0.2);
}

.card h3 {
    margin-bottom: 0.75rem;
}

.card p {
    color: var(--text-muted);
}

.cta {
    padding: 4rem 0;
    background: linear-gradient(120deg, rgba(56, 189, 248, 0.25), rgba(15, 23, 42, 0.85));
    color: #f8fafc;
}

.cta__content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.cta__form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cta__form input {
    padding: 0.65rem 1rem;
    border-radius: 999px;
    border: none;
    min-width: 240px;
}

.site-footer {
    padding: 2rem 0;
    background: var(--bg-darker);
    color: #cbd5f5;
}

.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-nav a {
    color: #cbd5f5;
    text-decoration: none;
    font-size: 0.95rem;
}

.footer-nav a:hover {
    color: #38d0f8;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }

    .auth-actions {
        gap: 0.5rem;
    }

    .auth-user summary {
        width: 100%;
        justify-content: space-between;
    }

    .auth-user__menu {
        left: 0;
        right: auto;
        min-width: 100%;
    }

    .cta__form {
        width: 100%;
    }

    .cta__form input {
        flex: 1;
        min-width: unset;
    }
}


.page-auth {
    min-height: 100vh;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.04), transparent 220px), var(--bg-light);
    display: flex;
    flex-direction: column;
}

.auth-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem;
}

.auth-card {
    width: min(420px, 100%);
    background: #ffffff;
    border-radius: 20px;
    padding: 2.5rem 2.75rem;
    box-shadow: 0 30px 60px -45px rgba(15, 23, 42, 0.45);
    border: 1px solid var(--border-color);
}

.auth-card--split {
    width: min(820px, 100%);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2.5rem;
}

.auth-pane {
    display: flex;
    flex-direction: column;
}

.auth-pane--secondary {
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 2rem;
}

.auth-pane--secondary h2 {
    margin-top: 0;
}

.auth-pane form + form {
    margin-top: 1.5rem;
}

.auth-card h1 {
    margin-bottom: 0.5rem;
    font-size: 1.9rem;
}

.auth-card__intro {
    margin-bottom: 1.75rem;
    color: var(--text-muted);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-field label {
    font-weight: 600;
    color: var(--text-main);
}

.form-field input {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field select,
.form-field textarea {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.form-field textarea {
    min-height: 140px;
    resize: vertical;
}

.form-two-cols {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.field-error {
    color: #dc2626;
    font-size: 0.875rem;
}

.field-hint {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: -0.35rem;
    margin-bottom: 0.75rem;
}

.password-rules {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.password-rules li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    position: relative;
    padding-left: 1.4rem;
}

.password-rules li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: rgba(148, 163, 184, 0.9);
    font-weight: bold;
}

.password-rules li.valid {
    color: #15803d;
}

.password-rules li.valid::before {
    content: '\2713';
    color: #15803d;
}

.password-rules li.invalid {
    color: #dc2626;
}

.password-rules li.invalid::before {
    content: '\2717';
    color: #dc2626;
}

.password-match {
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.password-match.valid {
    color: #15803d;
}

.password-match.invalid {
    color: #dc2626;
}

.profile-avatar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-avatar__body {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    align-items: start;
}

.profile-avatar__preview img {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #e2e8f0;
}

.profile-avatar__preview-link {
    display: inline-flex;
    border-radius: 12px;
    cursor: zoom-in;
}

.profile-avatar__preview-link[hidden] {
    display: none;
}

.profile-avatar__placeholder {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.4);
    display: grid;
    place-items: center;
    font-size: 2rem;
    color: rgba(148, 163, 184, 0.8);
    background: #f8fafc;
}

.profile-avatar__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-avatar__title {
    margin: 0;
    font-size: 1.05rem;
}

.profile-avatar__upload {
    display: inline-flex;
    flex-direction: column;
    gap: 0.45rem;
    font-weight: 600;
}

.profile-avatar__upload input[type="file"] {
    font-weight: 400;
}

.profile-avatar__status {
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.profile-avatar__status--success {
    color: #15803d;
}

.profile-avatar__status--error {
    color: #dc2626;
}

.avatar-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.avatar-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.avatar-modal__dialog {
    position: relative;
    max-width: min(520px, 92vw);
    max-height: 90vh;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 25px 60px -20px rgba(15, 23, 42, 0.55);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    overflow: hidden;
}

.avatar-modal__image {
    max-width: 100%;
    max-height: calc(80vh - 6rem);
    border-radius: 12px;
    object-fit: contain;
}

.avatar-modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.65);
    color: #ffffff;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.avatar-modal__close:hover {
    background: rgba(56, 189, 248, 0.9);
    transform: translateY(-1px);
}

body.avatar-modal-open {
    overflow: hidden;
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.alert--error {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.alert--success {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.auth-resend {
    margin-top: 1rem;
}

@media (max-width: 600px) {
    .auth-card {
        padding: 2rem 1.75rem;
    }

    .auth-card--split {
        padding: 2rem 1.5rem;
    }

    .profile-avatar__body {
        grid-template-columns: 1fr;
    }
}


.photo-upload__card {
    padding: 0.9rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
}

.photo-upload__controls {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.photo-upload__input {
    display: none;
}

.avatar-modal__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(15, 23, 42, 0.55);
    color: #ffffff;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.avatar-modal__nav:hover {
    background: rgba(56, 189, 248, 0.85);
}

.avatar-modal__nav:disabled,
.avatar-modal__nav.is-hidden {
    display: none;
}

.avatar-modal__nav--prev {
    left: 0.75rem;
}

.avatar-modal__nav--next {
    right: 0.75rem;
}

.avatar-modal__caption {
    margin-top: 0.5rem;
    text-align: center;
    max-width: min(520px, 80vw);
    width: 100%;
}

.avatar-modal__title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.avatar-modal__description {
    margin: 0;
    font-size: 0.9rem;
    color: #475569;
    white-space: pre-line;
}

.photo-upload__hint {
    color: #94a3b8;
    font-size: 0.8rem;
}

.photo-pref {
    margin-bottom: 2rem;
}

.photo-pref__checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #0f172a;
}

.photo-pref__checkbox input {
    width: 1rem;
    height: 1rem;
}
